This commit is contained in:
mashuai 2026-02-05 17:12:59 +08:00
parent 7f4dfd752d
commit c58c3055ec
2 changed files with 12 additions and 6 deletions

View File

@ -849,6 +849,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">
WHERE temp.status = #{status}
</if>
GROUP BY
temp.typeName,
temp.typeModelName ,
temp.maId
-- 排序proName和teamName都不为空的排在最前面
ORDER BY
-- 核心排序逻辑:两个字段都不为空的记录优先级最高

View File

@ -179,7 +179,8 @@
t.sampling_ratio,
t.is_check,
t.jiju_type,
mt2.type_name as materialName
mt2.type_name as materialName,
t.is_rs as isRs
FROM ma_type AS t
left join ma_type mt2 on t.parent_id = mt2.type_id
left join ma_type mt3 on mt2.parent_id = mt3.type_id
@ -263,6 +264,7 @@
<if test="jiJuType != null">jiJu_type,</if>
<if test="companyId != null">company_id,</if>
<if test="isLease != null and isLease != ''">is_lease,</if>
<if test="isRs != null">is_rs,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeName != null and typeName != ''">#{typeName},</if>
@ -302,6 +304,7 @@
<if test="jiJuType != null">#{jiJuType},</if>
<if test="companyId != null">#{companyId},</if>
<if test="isLease != null and isLease != ''">#{isLease},</if>
<if test="isRs != null">#{isRs},</if>
</trim>
</insert>
@ -355,6 +358,7 @@
<if test="thirdReportUrl != null and thirdReportUrl != ''">third_report_url = #{thirdReportUrl},</if>
<if test="otherReportName != null and otherReportName != ''">other_report_name = #{otherReportName},</if>
<if test="otherReportUrl != null and otherReportUrl != ''">other_report_url = #{otherReportUrl},</if>
<if test="isRs != null">is_rs = #{isRs},</if>
</trim>
where type_id = #{typeId}
</update>
@ -1451,11 +1455,9 @@
</if>
GROUP BY m.type_id
ORDER BY
m.sort_num ASC,
CASE
WHEN m.update_time > m.create_time THEN
m.update_time ELSE m.create_time
END DESC,
ISNULL(m.sort_num) ASC,
m.sort_num ASC, -- 优先按排序号升序
GREATEST(m.create_time, m.update_time) DESC,
m.create_time DESC
</select>