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