日更新

This commit is contained in:
jiang 2025-07-29 15:53:01 +08:00
parent a114f6cb13
commit 274a72d126
1 changed files with 41 additions and 3 deletions

View File

@ -75,9 +75,18 @@
ma_code = #{maCode}
</select>
<select id="selectAll" resultMap="BaseResultMap" resultType="com.bonus.material.codeCollection.domain.WsMaInfo">
SELECT *
FROM ws_ma_info
<select id="selectAll" resultType="com.bonus.material.codeCollection.domain.WsMaInfo">
SELECT * FROM (
SELECT
id AS id,
ma_code AS maCode,
ma_name AS maName,
next_check_time AS nextCheckTime,
this_check_time AS thisCheckTime,
ma_model AS maModel,
repair_man AS repairMan
FROM
ws_ma_info
<where>
<if test="maCode != null and maCode != ''">
and ma_code like concat('%', #{maCode}, '%')
@ -86,6 +95,35 @@
and qr_code = #{qrCode}
</if>
</where>
LIMIT 10
) AS t1
UNION ALL
SELECT * FROM (
SELECT
mm.ma_id AS id,
mm.ma_code AS maCode,
mt1.type_name AS maName,
mm.next_check_time AS nextCheckTime,
mm.this_check_time AS thisCheckTime,
mt.type_name AS maModel,
mm.check_man AS repairMan
FROM
ma_machine mm
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt1.type_id = mt.parent_id
<where>
<if test="maCode != null and maCode != ''">
and mm.ma_code like concat('%', #{maCode}, '%')
</if>
<if test="qrCode != null and qrCode != ''">
and qr_code = #{qrCode}
</if>
</where>
LIMIT 10
) AS t2
</select>