潘志宝
2024-12-12 b095cfc785d4a280ffaae086503a6a0e4f1fa4c1
提交 | 用户 | 时间
7fd198 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
4 <mapper namespace="com.iailab.module.model.mcs.pre.dao.MmPredictItemDao">
5
6     <resultMap id="ItemVO" type="com.iailab.module.model.mdk.vo.ItemVO">
7         <result property="id" column="ID"/>
8         <result property="itemNo" column="ITEMNO"/>
9         <result property="itemName" column="ITEMNAME"/>
10         <result property="itemType" column="ITEMTYPENAME"/>
11         <result property="predictLength" column="PREDICTLENGTH"/>
12         <result property="granularity" column="GRANULARITY"/>
13         <result property="status" column="STATUS"/>
14         <result property="isFuse" column="ISFUSE"/>
15         <result property="predictPhase" column="PREDICTPHASE"/>
16         <result property="workChecked" column="WORKCHECKED"/>
b368e6 17         <result property="lastTime" column="last_time"/>
7fd198 18     </resultMap>
19
20     <resultMap id="MergeItemVO" type="com.iailab.module.model.mdk.vo.MergeItemVO">
21         <result property="id" column="ID"/>
22         <result property="itemId" column="ITEMID"/>
23         <result property="expression" column="EXPRESSION"/>
24     </resultMap>
25
137356 26     <select id="getPageList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO"
27             parameterType="map">
28         SELECT
29         TMPI.ID,
30         TMPI.ITEMNO,
31         TMPI.ITEMNAME,
32         TMPI.ITEMTYPEID,
33         TMIT.ITEMTYPENAME,
34         TMPI.PREDICTLENGTH,
35         TMPI.GRANULARITY,
36         TMPI.ISFUSE,
37         TMPI.WORKCHECKED,
38         TDMI.MODULEID,
39         TDMI.ITEMORDER,
40         TMPI.STATUS,
41         TDMI.CATEGORYID,
6d6394 42         TMIS.last_time,
43         TMIS.status run_status,
b095cf 44         TMIS.duration,
45         TDMM.modulename
137356 46         FROM T_MM_PREDICT_ITEM TMPI
47         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
48         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
6d6394 49         LEFT JOIN t_mm_item_status TMIS ON TMIS.item_id = TMPI.ID
b095cf 50         LEFT JOIN T_DM_MODULE TDMM ON TDMM.id = TDMI.moduleid
137356 51         <where>
52             <if test="params.itemno != null and params.itemno != ''">
53                 AND TMPI.ITEMNO LIKE CONCAT('%', #{params.itemno},'%')
54             </if>
55             <if test="params.itemname != null and params.itemname != ''">
56                 AND TMPI.ITEMNAME LIKE CONCAT('%', #{params.itemname},'%')
57             </if>
58             <if test="params.itemtypeid != null and params.itemtypeid != ''">
59                 AND TMPI.ITEMTYPEID = #{params.itemtypeid}
60             </if>
61             <if test="params.itemtypename != null and params.itemtypename != ''">
62                 AND TMIT.ITEMTYPENAME = #{params.itemtypename}
63             </if>
64             <if test="params.status != null and params.status != ''">
65                 AND TMPI.STATUS = #{params.status}
66             </if>
b095cf 67             <if test="params.modulename != null and params.modulename != ''">
68                 AND TDMM.modulename LIKE CONCAT('%', #{params.modulename},'%')
69             </if>
137356 70         </where>
71         ORDER BY TMPI.CREATE_TIME DESC
72     </select>
73
19a4fb 74     <resultMap id="MmPredictItemRespVO" type="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO">
D 75         <result property="id" column="ID"/>
76         <result property="itemno" column="ITEMNO"/>
77         <result property="itemname" column="ITEMNAME"/>
78         <result property="itemtypeid" column="ITEMTYPEID"/>
79         <result property="itemtypename" column="ITEMTYPENAME"/>
f5365c 80         <result property="predictlength" column="predictlength"/>
19a4fb 81         <result property="granularity" column="GRANULARITY"/>
D 82         <result property="isfuse" column="ISFUSE"/>
83         <result property="workchecked" column="WORKCHECKED"/>
84         <result property="moduleid" column="MODULEID"/>
85         <result property="itemorder" column="ITEMORDER"/>
86         <result property="status" column="STATUS"/>
87         <result property="categoryid" column="CATEGORYID"/>
88         <collection property="outPuts" ofType="com.iailab.module.model.mcs.pre.vo.MmItemOutputRespVO">
89             <result property="id" column="out_put_id"/>
90             <result property="outputorder" column="out_put_order"/>
91             <result property="resultName" column="result_name"/>
92         </collection>
93     </resultMap>
94
95     <select id="queryList" resultMap="MmPredictItemRespVO" parameterType="map">
7fd198 96         SELECT
97         TMPI.ID,
98         TMPI.ITEMNO,
99         TMPI.ITEMNAME,
100         TMPI.ITEMTYPEID,
101         TMIT.ITEMTYPENAME,
f5365c 102         TMPI.predictlength,
7fd198 103         TMPI.GRANULARITY,
104         TMPI.ISFUSE,
105         TMPI.WORKCHECKED,
106         TDMI.MODULEID,
107         TDMI.ITEMORDER,
a97b38 108         TMPI.STATUS,
19a4fb 109         TDMI.CATEGORYID,
D 110         TMIO.id out_put_id,
111         TMIO.outputorder out_put_order,
112         TMIO.result_name
7fd198 113         FROM T_MM_PREDICT_ITEM TMPI
114         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
115         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
19a4fb 116         LEFT JOIN t_mm_item_output TMIO ON TMIO.itemid = TMPI.ID
7fd198 117         WHERE 1 = 1
a97b38 118         <if test="itemno != null and itemno != ''">
119             AND TMPI.ITEMNO LIKE CONCAT('%', #{itemno},'%')
7fd198 120         </if>
a97b38 121         <if test="itemname != null and itemname != ''">
122             AND TMPI.ITEMNAME LIKE CONCAT('%', #{itemname},'%')
7fd198 123         </if>
a97b38 124         <if test="itemtypeid != null and itemtypeid != ''">
125             AND TMPI.ITEMTYPEID = #{itemtypeid}
7fd198 126         </if>
a97b38 127         <if test="itemtypename != null and itemtypename != ''">
128             AND TMIT.ITEMTYPENAME = #{itemtypename}
7fd198 129         </if>
a97b38 130         <if test="status != null and status != ''">
131             AND TMPI.STATUS = #{status}
7fd198 132         </if>
19a4fb 133         ORDER BY TMPI.CREATE_TIME DESC,TMIO.outputorder
7fd198 134     </select>
135
136     <select id="getByModuleId" parameterType="map" resultMap="ItemVO">
137         SELECT t1.id,
138                t1.itemno,
139                t1.itemname,
140                t3.itemtypename,
141                t1.predictlength,
142                t1.granularity,
143                t1.status,
144                t1.isfuse,
145                t1.workchecked,
146                t1.unittransfactor
147         FROM t_mm_predict_item t1,
148              t_dm_module_item t2,
149              t_mm_item_type t3
150         WHERE t1.id = t2.itemid
151           AND t1.itemtypeid = t3.id
152           AND t2.moduleid = #{MODULEID}
153           AND t2.status = 1
154           AND t1.status = 1
155         ORDER BY t2.itemorder
156     </select>
157
158     <select id="getItem" parameterType="map" resultMap="ItemVO">
159         SELECT
160         t1.id,
161         t1.itemno ,
162         t1.itemname ,
163         t1.predictlength ,
164         t2.itemtypename,
165         t1.granularity,
166         t1.status,
167         t1.isfuse,
168         t1.predictphase,
b368e6 169         t1.workchecked,
170         t3.last_time
7fd198 171         FROM
b368e6 172         t_mm_predict_item t1
173         LEFT JOIN t_mm_item_type t2 on t2.id = t1.itemtypeid
174         LEFT JOIN t_mm_item_status t3 on t3.item_id = t1.id
175         <where>
176             <if test="ITEMID != null and ITEMID != ''">
177                 AND t1.id=#{ITEMID}
178             </if>
179             <if test="ITEMNO != null and ITEMNO != ''">
180                 t1.itemno=#{ITEMNO}
181             </if>
182         </where>
7fd198 183     </select>
184     <select id="getMergeItemByItemId" parameterType="map" resultMap="MergeItemVO">
185         SELECT t1.id,
186                t1.itemid,
187                t1.expression
188         FROM t_mm_predict_merge_item t1
189         WHERE t1.itemid = #{ITEMID}
190     </select>
191
192
193 </mapper>