Browse Source

2026-01-14

优化
master
fengyuan_yang 2 months ago
parent
commit
12d9d86a42
  1. 21
      src/main/resources/mapper/shopOrder/ProductionReportMapper.xml
  2. 4
      src/main/resources/mapper/sys/SystemLogDao.xml
  3. 28
      src/main/resources/mapper/warehouse/LabelTransactionLogMapper.xml

21
src/main/resources/mapper/shopOrder/ProductionReportMapper.xml

@ -261,8 +261,12 @@
B.StartDate as date1,
B.ReportDate as date2,
B.Reportedby,
(CASE WHEN ISNULL(A.status , '*') = '*' THEN '在制品' else a.status end) as roll_type ,
(CASE WHEN B.RollNo IS NOT NULL THEN '已消耗' WHEN ISNULL(A.status , '*') != '*' THEN '待入库' ELSE '未消耗' END) AS final_status,
RollType,
(CASE WHEN RollType ='删除卷' THEN '删除卷'
WHEN RollType <![CDATA[<>]]> '删除卷' AND B.RollNo IS NOT NULL THEN '已消耗'
WHEN RollType <![CDATA[<>]]> '删除卷' AND ISNULL(A.status, '*') = '*' AND B.RollNo IS NULL THEN '未消耗'
WHEN RollType <![CDATA[<>]]> '删除卷' AND ISNULL(A.status, '*') != '*' THEN '待入库' ELSE ''
END) AS finalStatus,
B.HistType,
a.partNo,
p.PartDescription AS partDesc,
@ -326,6 +330,12 @@
<if test=" spec != null and spec != ''">
AND p.Spec like '%'+#{spec}+'%'
</if>
<if test=" rollNo != null and rollNo != ''">
AND A.RollNo like '%'+#{rollNo}+'%'
</if>
<if test=" rollType != null and rollType != ''">
AND A.RollType = #{rollType}
</if>
</where>
ORDER BY A.CreatedDate DESC
<if test="page != null and limit != null">
@ -357,6 +367,7 @@
<if test=" createdOpsItemNo != null and createdOpsItemNo != '' and createdOpsItemNo != 0">
AND CAST(A.CreatedOpsItemNo AS VARCHAR) like '%'+CAST(#{createdOpsItemNo} AS VARCHAR)+'%'
</if>
<if test=" consumeOrderNo != null and consumeOrderNo != ''">
AND B.OrderNo like '%'+#{consumeOrderNo}+'%'
</if>
@ -375,6 +386,12 @@
<if test=" spec != null and spec != ''">
AND p.Spec like '%'+#{spec}+'%'
</if>
<if test=" rollNo != null and rollNo != ''">
AND A.RollNo like '%'+#{rollNo}+'%'
</if>
<if test=" rollType != null and rollType != ''">
AND A.RollType = #{rollType}
</if>
</where>
</select>
</mapper>

4
src/main/resources/mapper/sys/SystemLogDao.xml

@ -36,7 +36,7 @@
<where>
a.site in (select site from AccessSite where userID = #{userName}) OR a.site = '*'
and a.bu_no in (select bu_no from AccessBu where username = #{userName}) OR a.bu_no = '*'
and type &lt;&gt; 'Interface'
and a.type <![CDATA[<>]]> 'Interface'
<if test="interfaceName != null and interfaceName.trim() != ''">
AND a.interface_name LIKE '%' + #{interfaceName} + '%'
</if>
@ -89,7 +89,7 @@
<where>
a.site in (select site from AccessSite where userID = #{userName}) OR a.site = '*'
and a.bu_no in (select bu_no from AccessBu where username = #{userName}) OR a.bu_no = '*'
and type &lt;&gt; 'Interface'
and a.type <![CDATA[<>]]> 'Interface'
<if test="interfaceName != null and interfaceName.trim() != ''">
AND a.interface_name LIKE '%' + #{interfaceName} + '%'
</if>

28
src/main/resources/mapper/warehouse/LabelTransactionLogMapper.xml

@ -17,6 +17,8 @@
a.roll_qty AS rollQty,
a.batch_no AS batchNo,
a.part_no AS partNo,
d.PartDescription as partDesc,
d.Spec AS spec,
a.warehouse_id as warehouseId,
b.WareHouseName as warehouseName,
a.location_id as locationId,
@ -30,6 +32,7 @@
FROM StockTransactionLog as a
LEFT JOIN WareHouse as b ON a.site = b.site AND a.bu_no = b.bu_no AND a.warehouse_id = b.WareHouseID
LEFT JOIN Location as c ON a.site = c.site AND a.bu_no = c.bu_no AND a.location_id = c.LocationID
left join part as d on a.site = d.site and a.part_no = d.PartNo
WHERE a.site IN (SELECT site FROM AccessSite WHERE userID = #{query.userName})
AND a.bu_no IN (SELECT bu_no FROM AccessBu WHERE username = #{query.userName})
<if test="query.buNo != null and query.buNo != ''">
@ -44,12 +47,11 @@
<if test="query.partNo != null and query.partNo != ''">
AND a.part_no LIKE '%' + #{query.partNo} + '%'
</if>
<if test="query.partSpec != null and query.partSpec != ''">
AND EXISTS (
SELECT 1 FROM Part p
WHERE p.site = a.site AND p.bu_no = a.bu_no AND p.PartNo = a.part_no
AND p.PartSpecification LIKE '%' + #{query.partSpec} + '%'
)
<if test="query.partDesc != null and query.partDesc != ''">
AND d.PartDescription LIKE '%' + #{query.partDesc} + '%'
</if>
<if test="query.spec != null and query.spec != ''">
AND d.Spec LIKE '%' + #{query.spec} + '%'
</if>
<if test="query.documentNo != null and query.documentNo != ''">
AND a.document_no LIKE '%' + #{query.documentNo} + '%'
@ -77,6 +79,9 @@
<select id="queryTotal" resultType="int">
SELECT COUNT(1)
FROM StockTransactionLog as a
LEFT JOIN WareHouse as b ON a.site = b.site AND a.bu_no = b.bu_no AND a.warehouse_id = b.WareHouseID
LEFT JOIN Location as c ON a.site = c.site AND a.bu_no = c.bu_no AND a.location_id = c.LocationID
left join part as d on a.site = d.site and a.part_no = d.PartNo
WHERE a.site IN (SELECT site FROM AccessSite WHERE userID = #{query.userName})
AND a.bu_no IN (SELECT bu_no FROM AccessBu WHERE username = #{query.userName})
<if test="query.buNo != null and query.buNo != ''">
@ -91,12 +96,11 @@
<if test="query.partNo != null and query.partNo != ''">
AND a.part_no LIKE '%' + #{query.partNo} + '%'
</if>
<if test="query.partSpec != null and query.partSpec != ''">
AND EXISTS (
SELECT 1 FROM Part p
WHERE p.site = a.site AND p.bu_no = a.bu_no AND p.PartNo = a.part_no
AND p.PartSpecification LIKE '%' + #{query.partSpec} + '%'
)
<if test="query.partDesc != null and query.partDesc != ''">
AND d.PartDescription LIKE '%' + #{query.partDesc} + '%'
</if>
<if test="query.spec != null and query.spec != ''">
AND d.Spec LIKE '%' + #{query.spec} + '%'
</if>
<if test="query.documentNo != null and query.documentNo != ''">
AND a.document_no LIKE '%' + #{query.documentNo} + '%'

Loading…
Cancel
Save