|
|
@@ -1305,6 +1305,7 @@ type Ermcp3Wrstandard struct {
|
|
|
UPDATETIME string `json:"updatetime" xorm:"'UPDATETIME'"` // 更新时间
|
|
|
REMARK string `json:"remark" xorm:"'REMARK'"` // 备注
|
|
|
CONVERTFACTOR float64 `json:"convertfactor" xorm:"'CONVERTFACTOR'"` // 标仓系数
|
|
|
+ CANTRADE int32 `json:"cantrade" xorm:"'CANTRADE'"` // 是否允许交易 - 0:不允许 1:允许 -1:未配置(数据库里没有记录)
|
|
|
}
|
|
|
|
|
|
func (r *Ermcp3Wrstandard) calc() {
|
|
|
@@ -1312,29 +1313,31 @@ func (r *Ermcp3Wrstandard) calc() {
|
|
|
}
|
|
|
|
|
|
func (r *Ermcp3Wrstandard) buildSql() string {
|
|
|
- sqlId := "select WRSTANDARDID," +
|
|
|
- " WRSTANDARDCODE," +
|
|
|
- " DELIVERYGOODSID," +
|
|
|
- " UNITID," +
|
|
|
- " MINIVALUE," +
|
|
|
- " MINIVALUEDP," +
|
|
|
- " REALMINIVALUE," +
|
|
|
- " REALMINIVALUEDP," +
|
|
|
- " CREATORID," +
|
|
|
- " to_char(CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
|
|
|
- " WRSTANDARDNAME," +
|
|
|
- " ISVALID," +
|
|
|
- " to_char(UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
|
|
|
- " REMARK," +
|
|
|
- " CONVERTFACTOR," +
|
|
|
- " AREAUSERID" +
|
|
|
+ sqlId := "select t.WRSTANDARDID," +
|
|
|
+ " t.WRSTANDARDCODE," +
|
|
|
+ " t.DELIVERYGOODSID," +
|
|
|
+ " t.UNITID," +
|
|
|
+ " t.MINIVALUE," +
|
|
|
+ " t.MINIVALUEDP," +
|
|
|
+ " t.REALMINIVALUE," +
|
|
|
+ " t.REALMINIVALUEDP," +
|
|
|
+ " t.CREATORID," +
|
|
|
+ " to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
|
|
|
+ " t.WRSTANDARDNAME," +
|
|
|
+ " t.ISVALID," +
|
|
|
+ " to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
|
|
|
+ " t.REMARK," +
|
|
|
+ " t.CONVERTFACTOR," +
|
|
|
+ " t.AREAUSERID," +
|
|
|
+ " nvl(m.cantrade,-1) cantrade" +
|
|
|
" from wrstandard t" +
|
|
|
- " where 1=1"
|
|
|
+ " left join marketspotgoodsconfig m on t.wrstandardid = m.wrstandardid" +
|
|
|
+ " where 1 = 1"
|
|
|
if r.AREAUSERID > 0 {
|
|
|
sqlId += fmt.Sprintf(" and t.AREAUSERID=%v", r.AREAUSERID)
|
|
|
}
|
|
|
if r.DELIVERYGOODSID > 0 {
|
|
|
- sqlId = sqlId + fmt.Sprintf(" and DELIVERYGOODSID=%v", r.DELIVERYGOODSID)
|
|
|
+ sqlId = sqlId + fmt.Sprintf(" and t.DELIVERYGOODSID=%v", r.DELIVERYGOODSID)
|
|
|
}
|
|
|
sqlId += " order by createtime desc"
|
|
|
return sqlId
|