|
|
@@ -1077,6 +1077,16 @@ type QhjCusBankInfo struct {
|
|
|
CANMODIFYBANKCARD int32 `json:"canmodifybankcard" xorm:"CANMODIFYBANKCARD"` // 是否可修改银行卡号 - 0:不可 1:可以
|
|
|
CANALLOT int32 `json:"canallot" xorm:"CANALLOT"` // 是否支持跨行调拨 - 0:不支持 1:支持
|
|
|
CANALLOTQUERY int32 `json:"canallotquery" xorm:"CANALLOTQUERY"` // 是否支持跨行调拨查询 - 0:不支持 1:支持
|
|
|
+
|
|
|
+ TRADEDATE string `json:"tradedate" xorm:"TRADEDATE"` // 交易日(yyyyMMdd)
|
|
|
+ SIGNSTATUS int32 `json:"signstatus" xorm:"SIGNSTATUS"` // 当前签到/签退状态 - 1:签到 2:签退
|
|
|
+ UPDATETIME string `json:"updatetime" xorm:"UPDATETIME"` // 当前签到/签退更新时间
|
|
|
+ LASTSIGNINTIME string `json:"lastsignintime" xorm:"LASTSIGNINTIME"` // 最后签到时间
|
|
|
+ LASTSIGNOUTTIME string `json:"lastsignouttime" xorm:"LASTSIGNOUTTIME"` // 最后签退时间
|
|
|
+ LASTCHECKTIME string `json:"lastchecktime" xorm:"LASTCHECKTIME"` // 最后对账时间
|
|
|
+ LASTCHECKSTATUS int32 `json:"lastcheckstatus" xorm:"LASTCHECKSTATUS"` // 最后对账状态 - 对账状态 - 1:未对账 2:对账成功 3:对账失败
|
|
|
+ LASTCLEARTIME string `json:"lastcleartime" xorm:"LASTCLEARTIME"` // 最后清算时间
|
|
|
+ LASTCLEARSTATUS int32 `json:"lastclearstatus" xorm:"LASTCLEARSTATUS"` // 最后清算状态 - 1:未清算 2:清算成功 3:清算失败 4:清算部分成功
|
|
|
}
|
|
|
|
|
|
func (r *QhjCusBankInfo) calc() {
|
|
|
@@ -1084,7 +1094,22 @@ func (r *QhjCusBankInfo) calc() {
|
|
|
}
|
|
|
|
|
|
func (r *QhjCusBankInfo) buildSql() string {
|
|
|
- var sqlId utils.SQLVal = "SELECT t.CUSBANKID," +
|
|
|
+ var sqlId utils.SQLVal = "with tmp as" +
|
|
|
+ " (select *" +
|
|
|
+ " from (select row_number() over(partition by t.cusbankid order by t.tradedate desc) cn," +
|
|
|
+ " t.CUSBANKID id2," +
|
|
|
+ " t.TRADEDATE," +
|
|
|
+ " t.SIGNSTATUS," +
|
|
|
+ " to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
|
|
|
+ " to_char(t.LASTSIGNINTIME, 'yyyy-mm-dd hh24:mi:ss') LASTSIGNINTIME," +
|
|
|
+ " to_char(t.LASTSIGNOUTTIME, 'yyyy-mm-dd hh24:mi:ss') LASTSIGNOUTTIME," +
|
|
|
+ " to_char(t.LASTCHECKTIME, 'yyyy-mm-dd hh24:mi:ss') LASTCHECKTIME," +
|
|
|
+ " t.LASTCHECKSTATUS," +
|
|
|
+ " to_char(t.LASTCLEARTIME, 'yyyy-mm-dd hh24:mi:ss') LASTCLEARTIME," +
|
|
|
+ " t.LASTCLEARSTATUS" +
|
|
|
+ " from bank_cusbankstatus t)" +
|
|
|
+ " where cn = 1)" +
|
|
|
+ "SELECT t.CUSBANKID," +
|
|
|
" t.CUSBANKNAME," +
|
|
|
" t.CUSBANKSHORTNAME," +
|
|
|
" t.EXCHBANKID," +
|
|
|
@@ -1107,8 +1132,11 @@ func (r *QhjCusBankInfo) buildSql() string {
|
|
|
" t.ISNEEDCHECK," +
|
|
|
" t.CANMODIFYBANKCARD," +
|
|
|
" t.CANALLOT," +
|
|
|
- " t.CANALLOTQUERY" +
|
|
|
+ " t.CANALLOTQUERY," +
|
|
|
+ " tmp.*" +
|
|
|
" FROM BANK_CUSBANKINFO t" +
|
|
|
+ " LEFT JOIN tmp" +
|
|
|
+ " on t.cusbankid = tmp.id2" +
|
|
|
" WHERE 1 = 1"
|
|
|
return sqlId.String()
|
|
|
}
|