liriming
2024-11-29 15732a55b862cdc423475f4fb6b45fb8a7b55ed3
提交 | 用户 | 时间
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,
44         TMIS.duration
137356 45         FROM T_MM_PREDICT_ITEM TMPI
46         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
47         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
6d6394 48         LEFT JOIN t_mm_item_status TMIS ON TMIS.item_id = TMPI.ID
137356 49         <where>
50             <if test="params.itemno != null and params.itemno != ''">
51                 AND TMPI.ITEMNO LIKE CONCAT('%', #{params.itemno},'%')
52             </if>
53             <if test="params.itemname != null and params.itemname != ''">
54                 AND TMPI.ITEMNAME LIKE CONCAT('%', #{params.itemname},'%')
55             </if>
56             <if test="params.itemtypeid != null and params.itemtypeid != ''">
57                 AND TMPI.ITEMTYPEID = #{params.itemtypeid}
58             </if>
59             <if test="params.itemtypename != null and params.itemtypename != ''">
60                 AND TMIT.ITEMTYPENAME = #{params.itemtypename}
61             </if>
62             <if test="params.status != null and params.status != ''">
63                 AND TMPI.STATUS = #{params.status}
64             </if>
65         </where>
66         ORDER BY TMPI.CREATE_TIME DESC
67     </select>
68
19a4fb 69     <resultMap id="MmPredictItemRespVO" type="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO">
D 70         <result property="id" column="ID"/>
71         <result property="itemno" column="ITEMNO"/>
72         <result property="itemname" column="ITEMNAME"/>
73         <result property="itemtypeid" column="ITEMTYPEID"/>
74         <result property="itemtypename" column="ITEMTYPENAME"/>
75         <result property="granularity" column="GRANULARITY"/>
76         <result property="isfuse" column="ISFUSE"/>
77         <result property="workchecked" column="WORKCHECKED"/>
78         <result property="moduleid" column="MODULEID"/>
79         <result property="itemorder" column="ITEMORDER"/>
80         <result property="status" column="STATUS"/>
81         <result property="categoryid" column="CATEGORYID"/>
82         <collection property="outPuts" ofType="com.iailab.module.model.mcs.pre.vo.MmItemOutputRespVO">
83             <result property="id" column="out_put_id"/>
84             <result property="outputorder" column="out_put_order"/>
85             <result property="resultName" column="result_name"/>
86         </collection>
87     </resultMap>
88
89     <select id="queryList" resultMap="MmPredictItemRespVO" parameterType="map">
7fd198 90         SELECT
91         TMPI.ID,
92         TMPI.ITEMNO,
93         TMPI.ITEMNAME,
94         TMPI.ITEMTYPEID,
95         TMIT.ITEMTYPENAME,
96         TMPI.GRANULARITY,
97         TMPI.ISFUSE,
98         TMPI.WORKCHECKED,
99         TDMI.MODULEID,
100         TDMI.ITEMORDER,
a97b38 101         TMPI.STATUS,
19a4fb 102         TDMI.CATEGORYID,
D 103         TMIO.id out_put_id,
104         TMIO.outputorder out_put_order,
105         TMIO.result_name
7fd198 106         FROM T_MM_PREDICT_ITEM TMPI
107         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
108         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
19a4fb 109         LEFT JOIN t_mm_item_output TMIO ON TMIO.itemid = TMPI.ID
7fd198 110         WHERE 1 = 1
a97b38 111         <if test="itemno != null and itemno != ''">
112             AND TMPI.ITEMNO LIKE CONCAT('%', #{itemno},'%')
7fd198 113         </if>
a97b38 114         <if test="itemname != null and itemname != ''">
115             AND TMPI.ITEMNAME LIKE CONCAT('%', #{itemname},'%')
7fd198 116         </if>
a97b38 117         <if test="itemtypeid != null and itemtypeid != ''">
118             AND TMPI.ITEMTYPEID = #{itemtypeid}
7fd198 119         </if>
a97b38 120         <if test="itemtypename != null and itemtypename != ''">
121             AND TMIT.ITEMTYPENAME = #{itemtypename}
7fd198 122         </if>
a97b38 123         <if test="status != null and status != ''">
124             AND TMPI.STATUS = #{status}
7fd198 125         </if>
19a4fb 126         ORDER BY TMPI.CREATE_TIME DESC,TMIO.outputorder
7fd198 127     </select>
128
129     <select id="getByModuleId" parameterType="map" resultMap="ItemVO">
130         SELECT t1.id,
131                t1.itemno,
132                t1.itemname,
133                t3.itemtypename,
134                t1.predictlength,
135                t1.granularity,
136                t1.status,
137                t1.isfuse,
138                t1.workchecked,
139                t1.unittransfactor
140         FROM t_mm_predict_item t1,
141              t_dm_module_item t2,
142              t_mm_item_type t3
143         WHERE t1.id = t2.itemid
144           AND t1.itemtypeid = t3.id
145           AND t2.moduleid = #{MODULEID}
146           AND t2.status = 1
147           AND t1.status = 1
148         ORDER BY t2.itemorder
149     </select>
150
151     <select id="getItem" parameterType="map" resultMap="ItemVO">
152         SELECT
153         t1.id,
154         t1.itemno ,
155         t1.itemname ,
156         t1.predictlength ,
157         t2.itemtypename,
158         t1.granularity,
159         t1.status,
160         t1.isfuse,
161         t1.predictphase,
b368e6 162         t1.workchecked,
163         t3.last_time
7fd198 164         FROM
b368e6 165         t_mm_predict_item t1
166         LEFT JOIN t_mm_item_type t2 on t2.id = t1.itemtypeid
167         LEFT JOIN t_mm_item_status t3 on t3.item_id = t1.id
168         <where>
169             <if test="ITEMID != null and ITEMID != ''">
170                 AND t1.id=#{ITEMID}
171             </if>
172             <if test="ITEMNO != null and ITEMNO != ''">
173                 t1.itemno=#{ITEMNO}
174             </if>
175         </where>
7fd198 176     </select>
177     <select id="getMergeItemByItemId" parameterType="map" resultMap="MergeItemVO">
178         SELECT t1.id,
179                t1.itemid,
180                t1.expression
181         FROM t_mm_predict_merge_item t1
182         WHERE t1.itemid = #{ITEMID}
183     </select>
184
185
186 </mapper>