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 != ''"> <if test="status != null and status != ''">
WHERE temp.status = #{status} WHERE temp.status = #{status}
</if> </if>
GROUP BY
temp.typeName,
temp.typeModelName ,
temp.maId
-- 排序proName和teamName都不为空的排在最前面 -- 排序proName和teamName都不为空的排在最前面
ORDER BY ORDER BY
-- 核心排序逻辑:两个字段都不为空的记录优先级最高 -- 核心排序逻辑:两个字段都不为空的记录优先级最高

View File

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