潘志宝
2024-11-12 1337f249608bcbd7ad6cf244870e560a95821727
提交 | 用户 | 时间
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"/>
17     </resultMap>
18
19     <resultMap id="MergeItemVO" type="com.iailab.module.model.mdk.vo.MergeItemVO">
20         <result property="id" column="ID"/>
21         <result property="itemId" column="ITEMID"/>
22         <result property="expression" column="EXPRESSION"/>
23     </resultMap>
24
137356 25     <select id="getPageList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO"
26             parameterType="map">
27         SELECT
28         TMPI.ID,
29         TMPI.ITEMNO,
30         TMPI.ITEMNAME,
31         TMPI.ITEMTYPEID,
32         TMIT.ITEMTYPENAME,
33         TMPI.PREDICTLENGTH,
34         TMPI.GRANULARITY,
35         TMPI.ISFUSE,
36         TMPI.WORKCHECKED,
37         TDMI.MODULEID,
38         TDMI.ITEMORDER,
39         TMPI.STATUS,
40         TDMI.CATEGORYID,
6d6394 41         TMIS.last_time,
42         TMIS.status run_status,
43         TMIS.duration
137356 44         FROM T_MM_PREDICT_ITEM TMPI
45         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
46         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
6d6394 47         LEFT JOIN t_mm_item_status TMIS ON TMIS.item_id = TMPI.ID
137356 48         <where>
49             <if test="params.itemno != null and params.itemno != ''">
50                 AND TMPI.ITEMNO LIKE CONCAT('%', #{params.itemno},'%')
51             </if>
52             <if test="params.itemname != null and params.itemname != ''">
53                 AND TMPI.ITEMNAME LIKE CONCAT('%', #{params.itemname},'%')
54             </if>
55             <if test="params.itemtypeid != null and params.itemtypeid != ''">
56                 AND TMPI.ITEMTYPEID = #{params.itemtypeid}
57             </if>
58             <if test="params.itemtypename != null and params.itemtypename != ''">
59                 AND TMIT.ITEMTYPENAME = #{params.itemtypename}
60             </if>
61             <if test="params.status != null and params.status != ''">
62                 AND TMPI.STATUS = #{params.status}
63             </if>
64         </where>
65         ORDER BY TMPI.CREATE_TIME DESC
66     </select>
67
7fd198 68     <select id="queryList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO" parameterType="map">
69         SELECT
70         TMPI.ID,
71         TMPI.ITEMNO,
72         TMPI.ITEMNAME,
73         TMPI.ITEMTYPEID,
74         TMIT.ITEMTYPENAME,
75         TMPI.GRANULARITY,
76         TMPI.ISFUSE,
77         TMPI.WORKCHECKED,
78         TDMI.MODULEID,
79         TDMI.ITEMORDER,
a97b38 80         TMPI.STATUS,
7fd198 81         TDMI.CATEGORYID,
82         TMIO.POINTID,
83         TMIO.TAGNAME,
84         TMIO.RESULTTABLEID,
85         TMRT.TABLENAME
86         FROM T_MM_PREDICT_ITEM TMPI
87         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
88         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
89         LEFT JOIN T_MM_ITEM_OUTPUT TMIO ON TMIO.ITEMID = TMPI.ID
90         LEFT JOIN T_MM_RESULT_TABLE TMRT ON TMRT.ID = TMIO.RESULTTABLEID
91         WHERE 1 = 1
a97b38 92         <if test="itemno != null and itemno != ''">
93             AND TMPI.ITEMNO LIKE CONCAT('%', #{itemno},'%')
7fd198 94         </if>
a97b38 95         <if test="itemname != null and itemname != ''">
96             AND TMPI.ITEMNAME LIKE CONCAT('%', #{itemname},'%')
7fd198 97         </if>
a97b38 98         <if test="itemtypeid != null and itemtypeid != ''">
99             AND TMPI.ITEMTYPEID = #{itemtypeid}
7fd198 100         </if>
a97b38 101         <if test="itemtypename != null and itemtypename != ''">
102             AND TMIT.ITEMTYPENAME = #{itemtypename}
7fd198 103         </if>
a97b38 104         <if test="status != null and status != ''">
105             AND TMPI.STATUS = #{status}
7fd198 106         </if>
107         ORDER BY TMPI.CREATE_TIME DESC
108     </select>
109
110     <select id="getByModuleId" parameterType="map" resultMap="ItemVO">
111         SELECT t1.id,
112                t1.itemno,
113                t1.itemname,
114                t3.itemtypename,
115                t1.predictlength,
116                t1.granularity,
117                t1.status,
118                t1.isfuse,
119                t1.workchecked,
120                t1.unittransfactor
121         FROM t_mm_predict_item t1,
122              t_dm_module_item t2,
123              t_mm_item_type t3
124         WHERE t1.id = t2.itemid
125           AND t1.itemtypeid = t3.id
126           AND t2.moduleid = #{MODULEID}
127           AND t2.status = 1
128           AND t1.status = 1
129         ORDER BY t2.itemorder
130     </select>
131
132     <select id="getItem" parameterType="map" resultMap="ItemVO">
133         SELECT
134         t1.id,
135         t1.itemno ,
136         t1.itemname ,
137         t1.predictlength ,
138         t2.itemtypename,
139         t1.granularity,
140         t1.status,
141         t1.isfuse,
142         t1.predictphase,
143         t1.workchecked
144         FROM
1a2b62 145         t_mm_predict_item t1,
D 146         t_mm_item_type t2
7fd198 147         WHERE t1.itemtypeid=t2.id
148         <if test="ITEMID != null and ITEMID != ''">
149             AND t1.id=#{ITEMID}
150         </if>
151         <if test="ITEMNO != null and ITEMNO != ''">
152             t1.itemno=#{ITEMNO}
153         </if>
154     </select>
155     <select id="getMergeItemByItemId" parameterType="map" resultMap="MergeItemVO">
156         SELECT t1.id,
157                t1.itemid,
158                t1.expression
159         FROM t_mm_predict_merge_item t1
160         WHERE t1.itemid = #{ITEMID}
161     </select>
162
163
164 </mapper>