修饰代码优化

This commit is contained in:
mashuai 2025-08-19 21:59:30 +08:00
parent c1348ed43d
commit 385dbab69f
2 changed files with 6 additions and 6 deletions

View File

@ -318,7 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRepairQuestList" resultType="com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO"> <select id="selectRepairQuestList" resultType="com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO">
SELECT * FROM ( SELECT * FROM (
-- 第一个查询(时间条件:小于 2025-07-19 -- 第一个查询(时间条件:小于 2025-08-20
SELECT DISTINCT SELECT DISTINCT
tk.task_id AS taskId, tk.task_id AS taskId,
tk.CODE AS scrapNum, tk.CODE AS scrapNum,
@ -350,7 +350,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
WHERE WHERE
tk.task_type = #{taskType} tk.task_type = #{taskType}
AND tk.create_time &lt; '2025-08-06 00:00:00' AND tk.create_time &lt; '2025-08-20 00:00:00'
<if test="backUnit != null and backUnit != ''"> <if test="backUnit != null and backUnit != ''">
AND bui.unit_id = #{backUnit} AND bui.unit_id = #{backUnit}
</if> </if>
@ -380,7 +380,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UNION UNION
-- 第二个查询(时间条件:>= 2025-07-19 -- 第二个查询(时间条件:>= 2025-08-20
SELECT DISTINCT SELECT DISTINCT
tk.task_id AS taskId, tk.task_id AS taskId,
tk.CODE AS scrapNum, tk.CODE AS scrapNum,
@ -411,7 +411,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
WHERE WHERE
tk.task_type = #{taskType} tk.task_type = #{taskType}
AND tk.create_time &gt;= '2025-08-06 00:00:00' AND tk.create_time &gt;= '2025-08-20 00:00:00'
<if test="backUnit != null and backUnit != ''"> <if test="backUnit != null and backUnit != ''">
AND bui.unit_id = #{backUnit} AND bui.unit_id = #{backUnit}
</if> </if>

View File

@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
JOIN ma_type_repair mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId} JOIN ma_type_repair mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId}
</if> </if>
<where> <where>
rd.create_time &lt; '2025-08-06 00:00:00' rd.create_time &lt; '2025-08-20 00:00:00'
<if test="inputCode != null and inputCode != ''"> <if test="inputCode != null and inputCode != ''">
AND tt.CODE = #{inputCode} AND tt.CODE = #{inputCode}
</if> </if>
@ -123,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
JOIN ma_type_keeper mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId} JOIN ma_type_keeper mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId}
</if> </if>
<where> <where>
rd.create_time &gt;= '2025-08-06 00:00:00' rd.create_time &gt;= '2025-08-20 00:00:00'
<if test="inputCode != null and inputCode != ''"> <if test="inputCode != null and inputCode != ''">
AND tt.CODE = #{inputCode} AND tt.CODE = #{inputCode}
</if> </if>