Procházet zdrojové kódy

处理接口 /Qhj/QueryBankAccountSign 修改获取签约状态错误的问题

zhouxnsz před 1 rokem
rodič
revize
11a4a7c316
1 změnil soubory, kde provedl 44 přidání a 43 odebrání
  1. 44 43
      models/qhj.go

+ 44 - 43
models/qhj.go

@@ -909,50 +909,51 @@ func (r *QhjBankAccountSign) calc() {
 }
 
 func (r *QhjBankAccountSign) buildSql() string {
-	var sqlId utils.SQLVal = "SELECT t.ACCOUNTCODE," +
-		"       t.CUSBANKID," +
-		"       t.SIGNSTATUS," +
-		"       t.CURRENCY," +
-		"       t.ACCOUNTTYPE," +
-		"       t.ACCOUNTNAME," +
-		"       t.BANKCARDTYPE," +
-		"       t.BANKACCOUNTNO," +
-		"       t.BANKACCOUNTTYPE," +
-		"       t.BANKCHILDACCOUNT," +
-		"       t.BANKID," +
-		"       t.BRANCHBANKID," +
-		"       t.BRANCHBANKNAME," +
-		"       t.BANKACCOUNTNAME," +
-		"       t.CARDTYPE," +
-		"       t.CARDNO," +
-		"       t.BANKPROVINCE," +
-		"       t.BANKCITY," +
-		"       t.DIRECT," +
-		"       t.MOBILEPHONE," +
-		"       t.EXTENDINFO," +
-		"       t.EXCHTICKET," +
-		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
-		"       to_char(t.APPLICATIONTIME, 'yyyy-mm-dd hh24:mi:ss') APPLICATIONTIME," +
-		"       t.NETADDR," +
-		"       t.AUDITID," +
-		"       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME," +
-		"       t.APPLYEXCHTICKET," +
-		"       ta.accountid," +
-		"       ta.relateduserid," +
-		"       b.bankname," +
-		"       ci.cusbankname," +
-		"       slog.dealstatus DEALSTATUS," +
-		"       slog.remark REMARK" +
-		"  FROM BANK_ACCOUNTSIGN t" +
-		" INNER JOIN TAACCOUNT ta" +
-		"    on t.accountcode = to_char(ta.accountid)" +
-		" LEFT JOIN BANK_BANKINFO b on t.bankid=b.bankid" +
-		" LEFT JOIN bank_cusbankinfo ci ON ci.cusbankid = t.CUSBANKID" +
-		" LEFT JOIN (SELECT b.*, ROW_NUMBER() OVER (PARTITION BY b.exchticket ORDER BY b.createtime DESC) AS row_num " +
-		" FROM BANK_ACCOUNTSIGNLOG b) slog ON slog.exchticket = t.applyexchticket AND slog.row_num = 1" +
-		" WHERE 1 = 1" +
-		"   and ta.taaccounttype = 2"
+	var sqlId utils.SQLVal = `SELECT t.ACCOUNTCODE,
+		       t.CUSBANKID,
+		       t.SIGNSTATUS,
+		       t.CURRENCY,
+		       t.ACCOUNTTYPE,
+		       t.ACCOUNTNAME,
+		       t.BANKCARDTYPE,
+		       t.BANKACCOUNTNO,
+		       t.BANKACCOUNTTYPE,
+		       t.BANKCHILDACCOUNT,
+		       t.BANKID,
+		       t.BRANCHBANKID,
+		       t.BRANCHBANKNAME,
+		       t.BANKACCOUNTNAME,
+		       t.CARDTYPE,
+		       t.CARDNO,
+		       t.BANKPROVINCE,
+		       t.BANKCITY,
+		       t.DIRECT,
+		       t.MOBILEPHONE,
+		       t.EXTENDINFO,
+		       t.EXCHTICKET,
+		       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME,
+		       to_char(t.APPLICATIONTIME, 'yyyy-mm-dd hh24:mi:ss') APPLICATIONTIME,
+		       t.NETADDR,
+		       t.AUDITID,
+		       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME,
+		       t.APPLYEXCHTICKET,
+		       ta.accountid,
+		       ta.relateduserid,
+		       b.bankname,
+		       ci.cusbankname,
+		       slog.dealstatus DEALSTATUS,
+		       slog.remark REMARK
+		  FROM BANK_ACCOUNTSIGN t
+		 INNER JOIN TAACCOUNT ta
+		    on t.accountcode = to_char(ta.accountid)
+		 LEFT JOIN BANK_BANKINFO b on t.bankid=b.bankid
+		 LEFT JOIN bank_cusbankinfo ci ON ci.cusbankid = t.CUSBANKID
+		 LEFT JOIN (SELECT b.*, ROW_NUMBER() OVER (PARTITION BY b.exchticket ORDER BY b.createtime DESC) AS row_num 
+		 FROM BANK_ACCOUNTSIGNLOG b) slog ON slog.exchticket = t.applyexchticket AND slog.row_num = 1
+		 WHERE 1 = 1
+		   and ta.taaccounttype = 2`
 	sqlId.And("ta.RELATEDUSERID", r.RELATEDUSERID)
+	sqlId.OrderByDesc("t.APPLICATIONTIME")
 	return sqlId.String()
 }