|
|
@@ -19,34 +19,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and PAI_CSTNO = #{paramMap.companyId}
|
|
|
</if>
|
|
|
<if test="paramMap.zfpcrAccount != null and paramMap.zfpcrAccount != ''">
|
|
|
- AND (PAI_ACCNO = #{paramMap.zfpcrAccount} OR (PAI_STATUS = '2'
|
|
|
- AND PAI_ACCTYPE = '00'))
|
|
|
+ AND (PAI_ACCNO = #{paramMap.zfpcrAccount}
|
|
|
+ OR (PAI_STATUS = '2' AND PAI_ACCTYPE in ('00','01'))
|
|
|
</if>
|
|
|
<if test="paramMap.zfpcrAccount == null or paramMap.zfpcrAccount == ''">
|
|
|
and PAI_STATUS = '2'
|
|
|
- AND PAI_ACCTYPE = '00'
|
|
|
+ AND PAI_ACCTYPE in ('00','01')
|
|
|
</if>
|
|
|
- UNION
|
|
|
+<!-- UNION-->
|
|
|
|
|
|
- SELECT
|
|
|
- PBAI_BANKACCOUNT_ID 'value',
|
|
|
- PBAI_BANK_NAME 'address',
|
|
|
- CASE WHEN PBAI_BANKACCOUNT_ID = #{paramMap.zfpcrAccount} THEN 0 ELSE 1 END 'flag'
|
|
|
- FROM
|
|
|
- pay_bank_acc_inf
|
|
|
- LEFT JOIN sys_company
|
|
|
- ON scy_id = PBAI_CSTNO
|
|
|
- AND scy_type = '01'
|
|
|
- WHERE 1=1
|
|
|
- <if test="paramMap.companyId != null and paramMap.companyId != ''">
|
|
|
- and PBAI_CSTNO = #{paramMap.companyId}
|
|
|
- </if>
|
|
|
- <if test="paramMap.zfpcrAccount != null and paramMap.zfpcrAccount != ''">
|
|
|
- AND (PBAI_BANKACCOUNT_ID = #{paramMap.zfpcrAccount} OR PBAI_STATUS = '0')
|
|
|
- </if>
|
|
|
- <if test="paramMap.zfpcrAccount == null or paramMap.zfpcrAccount == ''">
|
|
|
- and PBAI_STATUS = '0'
|
|
|
- </if>
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- PBAI_BANKACCOUNT_ID 'value',-->
|
|
|
+<!-- PBAI_BANK_NAME 'address',-->
|
|
|
+<!-- CASE WHEN PBAI_BANKACCOUNT_ID = #{paramMap.zfpcrAccount} THEN 0 ELSE 1 END 'flag'-->
|
|
|
+<!-- FROM-->
|
|
|
+<!-- pay_bank_acc_inf-->
|
|
|
+<!-- LEFT JOIN sys_company-->
|
|
|
+<!-- ON scy_id = PBAI_CSTNO-->
|
|
|
+<!-- AND scy_type = '01'-->
|
|
|
+<!-- WHERE 1=1-->
|
|
|
+<!-- <if test="paramMap.companyId != null and paramMap.companyId != ''">-->
|
|
|
+<!-- and PBAI_CSTNO = #{paramMap.companyId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="paramMap.zfpcrAccount != null and paramMap.zfpcrAccount != ''">-->
|
|
|
+<!-- AND (PBAI_BANKACCOUNT_ID = #{paramMap.zfpcrAccount} OR PBAI_STATUS = '0')-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="paramMap.zfpcrAccount == null or paramMap.zfpcrAccount == ''">-->
|
|
|
+<!-- and PBAI_STATUS = '0'-->
|
|
|
+<!-- </if>-->
|
|
|
ORDER BY flag ASC
|
|
|
</select>
|
|
|
</mapper>
|