Commit 35aad53e2979a5aeeac3614cddc95ca8ac7099fc
1 parent
9c304693
APP端已办接口重构
Showing
1 changed file
with
101 additions
and
60 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoExtMapper.java
| ... | ... | @@ -25,37 +25,58 @@ import org.apache.ibatis.annotations.*; |
| 25 | 25 | */ |
| 26 | 26 | @Mapper |
| 27 | 27 | public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { |
| 28 | - @Select("select m.*," + | |
| 29 | - " t.ID_ AS task_id," + | |
| 30 | - " t.NAME_ AS task_name," + | |
| 31 | - " pd.NAME_ AS process_definition_name," + | |
| 32 | - " t.START_TIME_ ," + | |
| 33 | - " t.END_TIME_ ," + | |
| 34 | - " pd.KEY_ " + | |
| 35 | - " FROM act_hi_taskinst t" + | |
| 36 | - " LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_" + | |
| 37 | - " LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id" + | |
| 38 | - " WHERE 1=1" + | |
| 39 | - " AND t.END_TIME_ IS NOT NULL " + | |
| 40 | - " <if test='query.userId != null'>AND t.ASSIGNEE_ = #{query.userId}</if> "+ | |
| 41 | - " <if test='query.key != null'>AND pd.KEY_ = #{query.key}</if> "+ | |
| 42 | - " AND m.deleted = 0"+ | |
| 43 | - " <if test='query.startTime != null'> " + | |
| 44 | - " AND t.START_TIME_ >= #{query.startTime} " + | |
| 45 | - " </if> " + | |
| 46 | - " <if test='query.endTime != null'> " + | |
| 47 | - " AND t.END_TIME_ <= #{query.endTime} " + | |
| 48 | - " </if> " + | |
| 49 | - " <if test='query.busiLine != null'>AND m.busi_line = #{query.busiLine}</if> "+ | |
| 50 | - " <if test='query.orderNo != null and query.orderNo != '''>AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')</if> "+ | |
| 51 | - " <if test='query.orderName != null and query.orderName != '''>AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')</if> "+ | |
| 52 | - " <if test='query.remark != null and query.remark != '''>AND m.remark LIKE CONCAT('%', #{query.remark}, '%')</if> "+ | |
| 53 | - " <if test='query.roadName != null and query.roadName != '''>AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')</if> "+ | |
| 54 | - " <if test='query.streetName != null'>AND m.order_no = #{query.orderNo}</if> "+ | |
| 55 | - " <if test='query.curingLevelId != null'>AND m.curing_level_id = #{query.curingLevelId}</if> "+ | |
| 56 | - " ORDER BY t.END_TIME_ desc " | |
| 57 | - | |
| 58 | - ) | |
| 28 | + @Select({ | |
| 29 | + "<script>", | |
| 30 | + "SELECT", | |
| 31 | + " m.*,", | |
| 32 | + " t.ID_ AS task_id,", | |
| 33 | + " t.NAME_ AS task_name,", | |
| 34 | + " pd.NAME_ AS process_definition_name,", | |
| 35 | + " t.START_TIME_,", | |
| 36 | + " t.END_TIME_,", | |
| 37 | + " pd.KEY_", | |
| 38 | + "FROM act_hi_taskinst t", | |
| 39 | + "LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_", | |
| 40 | + "LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id AND m.deleted = 0", | |
| 41 | + "WHERE 1=1", | |
| 42 | + " AND t.END_TIME_ IS NOT NULL", | |
| 43 | + " <if test='query.userId != null'>", | |
| 44 | + " AND t.ASSIGNEE_ = #{query.userId}", | |
| 45 | + " </if>", | |
| 46 | + " <if test='query.key != null'>", | |
| 47 | + " AND pd.KEY_ = #{query.key}", | |
| 48 | + " </if>", | |
| 49 | + " <if test='query.startTime != null'>", | |
| 50 | + " <![CDATA[ AND t.START_TIME_ >= #{query.startTime} ]]>", | |
| 51 | + " </if>", | |
| 52 | + " <if test='query.endTime != null'>", | |
| 53 | + " <![CDATA[ AND t.END_TIME_ <= #{query.endTime} ]]>", | |
| 54 | + " </if>", | |
| 55 | + " <if test='query.busiLine != null'>", | |
| 56 | + " AND m.busi_line = #{query.busiLine}", | |
| 57 | + " </if>", | |
| 58 | + " <if test=\"query.orderNo != null and query.orderNo != ''\">", | |
| 59 | + " AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')", | |
| 60 | + " </if>", | |
| 61 | + " <if test=\"query.orderName != null and query.orderName != ''\">", | |
| 62 | + " AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')", | |
| 63 | + " </if>", | |
| 64 | + " <if test=\"query.remark != null and query.remark != ''\">", | |
| 65 | + " AND m.remark LIKE CONCAT('%', #{query.remark}, '%')", | |
| 66 | + " </if>", | |
| 67 | + " <if test=\"query.roadName != null and query.roadName != ''\">", | |
| 68 | + " AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')", | |
| 69 | + " </if>", | |
| 70 | + " <if test=\"query.streetName != null and query.streetName != ''\">", | |
| 71 | + " AND m.street_name = #{query.streetName}", | |
| 72 | + " <!-- 若需模糊匹配,改为:AND m.street_name LIKE CONCAT('%', #{query.streetName}, '%') -->", | |
| 73 | + " </if>", | |
| 74 | + " <if test='query.curingLevelId != null'>", | |
| 75 | + " AND m.curing_level_id = #{query.curingLevelId}", | |
| 76 | + " </if>", | |
| 77 | + "ORDER BY t.END_TIME_ DESC", | |
| 78 | + "</script>" | |
| 79 | + }) | |
| 59 | 80 | @Results({ |
| 60 | 81 | @Result(column = "id", property = "id"), |
| 61 | 82 | @Result(column = "busi_line", property = "busiLine"), |
| ... | ... | @@ -107,35 +128,55 @@ public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { |
| 107 | 128 | return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); |
| 108 | 129 | } |
| 109 | 130 | |
| 110 | - @Select("select m.*," + | |
| 111 | - " t.ID_ AS task_id," + | |
| 112 | - " t.NAME_ AS task_name," + | |
| 113 | - " pd.NAME_ AS process_definition_name," + | |
| 114 | - " t.CREATE_TIME_ as START_TIME_," + | |
| 115 | - " t.DUE_DATE_ as END_TIME_," + | |
| 116 | - " pd.KEY_ " + | |
| 117 | - " FROM act_ru_task t" + | |
| 118 | - " LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_" + | |
| 119 | - " LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id" + | |
| 120 | - " WHERE 1=1" + | |
| 121 | - " AND t.END_TIME_ IS NOT NULL " + | |
| 122 | - " <if test='query.userId != null'>AND t.ASSIGNEE_ = #{query.userId}</if> "+ | |
| 123 | - " <if test='query.key != null'>AND pd.KEY_ = #{query.key}</if> "+ | |
| 124 | - " AND t.SUSPENSION_STATE_ = 1 "+ | |
| 125 | - " AND m.deleted = 0"+ | |
| 126 | - " <if test='query.startTime != null'> " + | |
| 127 | - " AND t.CREATE_TIME_ >= #{query.startTime} " + | |
| 128 | - " </if> " + | |
| 129 | - " <if test='query.busiLine != null'>AND m.busi_line = #{query.busiLine}</if> "+ | |
| 130 | - " <if test='query.orderNo != null and query.orderNo != '''>AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')</if> "+ | |
| 131 | - " <if test='query.orderName != null and query.orderName != '''>AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')</if> "+ | |
| 132 | - " <if test='query.remark != null and query.remark != '''>AND m.remark LIKE CONCAT('%', #{query.remark}, '%')</if> "+ | |
| 133 | - " <if test='query.roadName != null and query.roadName != '''>AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')</if> "+ | |
| 134 | - " <if test='query.streetName != null'>AND m.order_no = #{query.orderNo}</if> "+ | |
| 135 | - " <if test='query.curingLevelId != null'>AND m.curing_level_id = #{query.curingLevelId}</if> "+ | |
| 136 | - " ORDER BY t.CREATE_TIME_ desc " | |
| 137 | - | |
| 138 | - ) | |
| 131 | + @Select({ | |
| 132 | + "<script>", | |
| 133 | + "SELECT", | |
| 134 | + " m.*,", | |
| 135 | + " t.ID_ AS task_id,", | |
| 136 | + " t.NAME_ AS task_name,", | |
| 137 | + " pd.NAME_ AS process_definition_name,", | |
| 138 | + " t.CREATE_TIME_ AS START_TIME_,", | |
| 139 | + " t.DUE_DATE_ AS END_TIME_,", | |
| 140 | + " pd.KEY_", | |
| 141 | + "FROM act_ru_task t", | |
| 142 | + "LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_", | |
| 143 | + "LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id AND m.deleted = 0", | |
| 144 | + "WHERE 1=1", | |
| 145 | + " AND t.SUSPENSION_STATE_ = 1", | |
| 146 | + " <if test='query.userId != null'>", | |
| 147 | + " AND t.ASSIGNEE_ = #{query.userId}", | |
| 148 | + " </if>", | |
| 149 | + " <if test='query.key != null'>", | |
| 150 | + " AND pd.KEY_ = #{query.key}", | |
| 151 | + " </if>", | |
| 152 | + " <if test='query.startTime != null'>", | |
| 153 | + " <![CDATA[ AND t.CREATE_TIME_ >= #{query.startTime} ]]>", | |
| 154 | + " </if>", | |
| 155 | + " <if test='query.busiLine != null'>", | |
| 156 | + " AND m.busi_line = #{query.busiLine}", | |
| 157 | + " </if>", | |
| 158 | + " <if test=\"query.orderNo != null and query.orderNo != ''\">", | |
| 159 | + " AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')", | |
| 160 | + " </if>", | |
| 161 | + " <if test=\"query.orderName != null and query.orderName != ''\">", | |
| 162 | + " AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')", | |
| 163 | + " </if>", | |
| 164 | + " <if test=\"query.remark != null and query.remark != ''\">", | |
| 165 | + " AND m.remark LIKE CONCAT('%', #{query.remark}, '%')", | |
| 166 | + " </if>", | |
| 167 | + " <if test=\"query.roadName != null and query.roadName != ''\">", | |
| 168 | + " AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')", | |
| 169 | + " </if>", | |
| 170 | + " <if test=\"query.streetName != null and query.streetName != ''\">", | |
| 171 | + " AND m.street_name = #{query.streetName}", | |
| 172 | + " <!-- 若需模糊匹配,改为:AND m.street_name LIKE CONCAT('%', #{query.streetName}, '%') -->", | |
| 173 | + " </if>", | |
| 174 | + " <if test='query.curingLevelId != null'>", | |
| 175 | + " AND m.curing_level_id = #{query.curingLevelId}", | |
| 176 | + " </if>", | |
| 177 | + "ORDER BY t.CREATE_TIME_ DESC", | |
| 178 | + "</script>" | |
| 179 | + }) | |
| 139 | 180 | @Results({ |
| 140 | 181 | @Result(column = "id", property = "id"), |
| 141 | 182 | @Result(column = "busi_line", property = "busiLine"), | ... | ... |