| | |
| | | select * from ( |
| | | SELECT cqmd.*, |
| | | CASE |
| | | WHEN cqmder.is_finish = 1 THEN 2 |
| | | WHEN cqmder.is_finish = 1 THEN 3 |
| | | WHEN cqmder.is_finish = 0 THEN 2 |
| | | WHEN cqmder.quality_monitor_details_id IS NOT NULL THEN 1 |
| | | ELSE 0 END details_ratify_status, |
| | | CASE |
| | |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | order by quality_monitor_id, monitor_purpose, -- 提取年份 |
| | | CAST(SUBSTRING(planned_time, 1, 4) AS SIGNED) ASC, |
| | | -- 提取月份 |
| | | CASE |
| | | WHEN planned_time LIKE '% - %' THEN 1 |
| | | ELSE CAST(SUBSTRING_INDEX(SUBSTRING(planned_time, 6), '月', 1) AS SIGNED) |
| | | END ASC |
| | | </select> |
| | | </mapper> |