|
|
|
@ -31,6 +31,9 @@
|
|
|
|
|
a1.auditTime,
|
|
|
|
|
bu.isStack,
|
|
|
|
|
bu.groupBuy,
|
|
|
|
|
bp.prepnSpec,
|
|
|
|
|
COALESCE(bp.ylqxzcrbarmc,bp.manufactory) as manufactory,
|
|
|
|
|
bp.zczbhhzbapzbh,
|
|
|
|
|
GROUP_CONCAT(ioi.invoiceEncode ORDER BY ioi.invoiceEncode SEPARATOR ',') AS invoiceCodes,
|
|
|
|
|
b1.NAME AS fromCorpName,
|
|
|
|
|
basic_bussiness_type.name billTypeName
|
|
|
|
@ -38,6 +41,7 @@
|
|
|
|
|
LEFT JOIN io_order a1 ON a1.billNo = a2.orderIdFk
|
|
|
|
|
LEFT JOIN basic_corp b1 ON b1.erpId = a1.fromCorp
|
|
|
|
|
LEFT JOIN basic_udirel bu ON a2.bindRlFk = bu.id
|
|
|
|
|
inner JOIN basic_products bp ON bp.uuid = bu.uuid
|
|
|
|
|
left join basic_bussiness_type on a1.action = basic_bussiness_type.action
|
|
|
|
|
LEFT JOIN io_order_invoice ioi ON a1.billNo = ioi.orderIdFk
|
|
|
|
|
left join auth_warehouse aw on aw.code = a1.fromInvCode
|
|
|
|
@ -52,9 +56,9 @@
|
|
|
|
|
<if test="productType != null and productType != ''">
|
|
|
|
|
AND a1.productType = #{productType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="keyWords != null and keyWords != ''">
|
|
|
|
|
AND (aw.name like concat('%', #{keyWords}, '%') or b1.name like concat('%', #{keyWords}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
<!-- <if test="keyWords != null and keyWords != ''">-->
|
|
|
|
|
<!-- AND (aw.name like concat('%', #{keyWords}, '%') or b1.name like concat('%', #{keyWords}, '%'))-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<if test="nameCode != null and nameCode != ''">
|
|
|
|
|
AND a2.nameCode = #{nameCode}
|
|
|
|
|
</if>
|
|
|
|
@ -109,12 +113,29 @@
|
|
|
|
|
<if test="productName != null and productName != ''">
|
|
|
|
|
AND a2.coName like concat('%', #{productName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="prepnSpec != null and prepnSpec != ''">
|
|
|
|
|
AND bp.prepnSpec like concat('%', #{prepnSpec}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="actions != null and actions.size() != 0">
|
|
|
|
|
AND a1.`action` in
|
|
|
|
|
<foreach collection="actions" index="index" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="keyWords != '' and keyWords != null">
|
|
|
|
|
AND (
|
|
|
|
|
a2.nameCode LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or a2.coName like concat('%', #{keyWords}, '%')
|
|
|
|
|
or a2.orderIdFk LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or a2.spec LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or bp.prepnSpec LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or a2.batchNo like concat('%', #{keyWords}, '%')
|
|
|
|
|
or bp.zczbhhzbapzbh LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or bp.manufactory LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or bp.ylqxzcrbarywmc LIKE concat('%', #{keyWords}, '%')
|
|
|
|
|
or b1.name like concat('%', #{keyWords}, '%'))
|
|
|
|
|
or aw.name like concat('%', #{keyWords}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
group by a2.id
|
|
|
|
|
</select>
|
|
|
|
|