优化sql

dev_2.5_ocean
qiuyt 4 months ago
parent 620087efe6
commit 1e37d99c0c

@ -67,7 +67,7 @@
</if>
<if test="unionKey != null">
AND (
icob.billNo like concat('%', #{unionKey}, '%')
icob.billNo like concat(#{unionKey}, '%')
or icob.fromCorp like concat('%', #{unionKey}, '%')
or icob.fromCorpName like concat('%', #{unionKey}, '%')
or icob.backupOrderRemark1 like concat('%', #{unionKey}, '%')
@ -104,7 +104,7 @@
and icob.uploadStatus = #{uploadStatus}
</if>
<if test="keyWords != null and keyWords != ''">
and (icob.billNo like concat('%', #{keyWords}, '%')
and (icob.billNo like concat( #{keyWords}, '%')
or icob.fromCorp like concat('%', #{keyWords}, '%')
or icob.workPlaceCode like concat('%', #{keyWords}, '%')
or icob.busType like concat('%', #{keyWords}, '%')

@ -38,12 +38,12 @@
</if>
<if test="unionCode != '' and unionCode != null">
and (
bp.nameCode LIKE concat('%', #{unionCode}, '%')
or bp.ybbm LIKE concat('%', #{unionCode}, '%')
or bp.sptm LIKE concat('%', #{unionCode}, '%'))
bp.nameCode LIKE concat( #{unionCode}, '%')
or bp.ybbm LIKE concat( #{unionCode}, '%')
or bp.sptm LIKE concat(#{unionCode}, '%'))
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%', #{ggxh}, '%')
AND ggxh LIKE concat( #{ggxh}, '%')
</if>
</where>
group by icob.id

@ -24,16 +24,16 @@
AND icob.relId = #{relId}
</if>
<if test="cpmctymc != null and cpmctymc != ''">
AND icob.cpmctymc LIKE concat('%', #{cpmctymc}, '%')
AND icob.cpmctymc LIKE concat( #{cpmctymc}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
bp.nameCode LIKE concat('%', #{unionCode}, '%')
or bp.ybbm LIKE concat('%', #{unionCode}, '%')
bp.nameCode LIKE concat( #{unionCode}, '%')
or bp.ybbm LIKE concat( #{unionCode}, '%')
or bp.sptm LIKE concat('%', #{unionCode}, '%'))
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat('%', #{ggxh}, '%')
AND ggxh LIKE concat( #{ggxh}, '%')
</if>
</where>
group by icob.id

@ -47,7 +47,7 @@
LEFT JOIN basic_products bp ON bp.nameCode = a.productCode
<where>
<if test="productCode != '' and productCode != null">
AND a.productCode LIKE concat('%', #{productCode}, '%')
AND a.productCode LIKE concat( #{productCode}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND a.batchNo = #{batchNo}
@ -57,9 +57,9 @@
</if>
<if test="keyWords != '' and keyWords != null">
and (
a.productCode LIKE concat('%', #{keyWords}, '%')
or a.subTypeNo LIKE concat('%', #{keyWords}, '%')
or a.packageSpec LIKE concat('%', #{keyWords}, '%'))
a.productCode LIKE concat( #{keyWords}, '%')
or a.subTypeNo LIKE concat( #{keyWords}, '%')
or a.packageSpec LIKE concat( #{keyWords}, '%'))
</if>
<if test="lineName != '' and lineName != null">
AND a.lineName LIKE concat('%', #{lineName}, '%')

@ -47,7 +47,7 @@
left join rel_code_batch rcb on rcb.id = rcd.batchIdFk
<where>
<if test="productCode != '' and productCode != null">
AND rcb.productCode LIKE concat('%', #{productCode}, '%')
AND rcb.productCode LIKE concat(#{productCode}, '%')
</if>
<if test="batchIdFk != null">
AND rcb.id = #{batchIdFk}
@ -63,9 +63,9 @@
</if>
<if test="keyWords != '' and keyWords != null">
and (
rcb.productCode LIKE concat('%', #{keyWords}, '%')
or rcb.subTypeNo LIKE concat('%', #{keyWords}, '%')
or rcb.packageSpec LIKE concat('%', #{keyWords}, '%'))
rcb.productCode LIKE concat( #{keyWords}, '%')
or rcb.subTypeNo LIKE concat( #{keyWords}, '%')
or rcb.packageSpec LIKE concat( #{keyWords}, '%'))
</if>
<if test="lineName != '' and lineName != null">
AND rcb.lineName LIKE concat('%', #{lineName}, '%')

@ -5290,8 +5290,26 @@ CALL Modify_UNIQUE_index('io_split_code', 'code', 'idex_split_code', 'BTREE');
CALL Modify_index('io_split_code', 'workPlaceCode', 'idex_split_workPlaceCode', 'BTREE');
CALL Modify_index('io_collect_code_backup', 'code', 'idex_io_collect_code_backup_code', 'BTREE');
CALL Modify_index('io_collect_code_backup', 'billNo', 'idex_io_collect_code_backup_billNo', 'BTREE');
CALL Modify_index('io_collect_code_backup', 'fromType', 'idex_io_collect_code_backup_fromType', 'BTREE');
CALL Modify_index('io_collect_code_backup', 'fromCorp', 'idex_io_collect_code_backup_fromCorp', 'BTREE');
CALL Modify_index('rel_code_detail', 'curCode', 'rel_code_detail_curCode', 'BTREE');
CALL Modify_index('rel_code_detail', 'curCode', 'rel_code_detail_parentCode', 'BTREE');
CALL Modify_index('io_collect_order_biz_backup', 'orderIdFk', 'io_collect_order_biz_backup_orderIdFk', 'BTREE');
CALL Modify_index('io_collect_order_biz_backup', 'ybbm', 'io_collect_order_biz_backup_ybbm', 'BTREE');
CALL Modify_index('io_collect_order_backup', 'orderId', 'io_collect_order_backup_orderId', 'BTREE');
CALL Modify_index('io_collect_order_backup', 'billNo', 'io_collect_order_backup_billNo', 'BTREE');
CALL Modify_index('io_collect_order_backup', 'fromCorp', 'io_collect_order_backup_fromCorp', 'BTREE');
CALL Modify_index('io_collect_order_code_man', 'udiCode', 'io_collect_order_code_man_udiCode', 'BTREE');
CALL Modify_index('io_collect_order_code_man', 'relId', 'io_collect_order_code_man_relId', 'BTREE');
CALL Modify_index('rel_code_batch', 'productCode', 'rel_code_batch_productCode', 'BTREE');
CALL Modify_index('rel_code_batch', 'curCode', 'rel_code_batch_curCode', 'BTREE');
CALL Modify_index('rel_code_batch', 'packageSpec', 'rel_code_batch_packageSpec', 'BTREE');

Loading…
Cancel
Save