潘志宝
2024-11-14 b368e6092f83b98a9d81ba48b22ece51d5807112
提交 | 用户 | 时间
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
7fd198 69     <select id="queryList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO" parameterType="map">
70         SELECT
71         TMPI.ID,
72         TMPI.ITEMNO,
73         TMPI.ITEMNAME,
74         TMPI.ITEMTYPEID,
75         TMIT.ITEMTYPENAME,
76         TMPI.GRANULARITY,
77         TMPI.ISFUSE,
78         TMPI.WORKCHECKED,
79         TDMI.MODULEID,
80         TDMI.ITEMORDER,
a97b38 81         TMPI.STATUS,
4133d5 82         TDMI.CATEGORYID
7fd198 83         FROM T_MM_PREDICT_ITEM TMPI
84         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
85         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
86         WHERE 1 = 1
a97b38 87         <if test="itemno != null and itemno != ''">
88             AND TMPI.ITEMNO LIKE CONCAT('%', #{itemno},'%')
7fd198 89         </if>
a97b38 90         <if test="itemname != null and itemname != ''">
91             AND TMPI.ITEMNAME LIKE CONCAT('%', #{itemname},'%')
7fd198 92         </if>
a97b38 93         <if test="itemtypeid != null and itemtypeid != ''">
94             AND TMPI.ITEMTYPEID = #{itemtypeid}
7fd198 95         </if>
a97b38 96         <if test="itemtypename != null and itemtypename != ''">
97             AND TMIT.ITEMTYPENAME = #{itemtypename}
7fd198 98         </if>
a97b38 99         <if test="status != null and status != ''">
100             AND TMPI.STATUS = #{status}
7fd198 101         </if>
102         ORDER BY TMPI.CREATE_TIME DESC
103     </select>
104
105     <select id="getByModuleId" parameterType="map" resultMap="ItemVO">
106         SELECT t1.id,
107                t1.itemno,
108                t1.itemname,
109                t3.itemtypename,
110                t1.predictlength,
111                t1.granularity,
112                t1.status,
113                t1.isfuse,
114                t1.workchecked,
115                t1.unittransfactor
116         FROM t_mm_predict_item t1,
117              t_dm_module_item t2,
118              t_mm_item_type t3
119         WHERE t1.id = t2.itemid
120           AND t1.itemtypeid = t3.id
121           AND t2.moduleid = #{MODULEID}
122           AND t2.status = 1
123           AND t1.status = 1
124         ORDER BY t2.itemorder
125     </select>
126
127     <select id="getItem" parameterType="map" resultMap="ItemVO">
128         SELECT
129         t1.id,
130         t1.itemno ,
131         t1.itemname ,
132         t1.predictlength ,
133         t2.itemtypename,
134         t1.granularity,
135         t1.status,
136         t1.isfuse,
137         t1.predictphase,
b368e6 138         t1.workchecked,
139         t3.last_time
7fd198 140         FROM
b368e6 141         t_mm_predict_item t1
142         LEFT JOIN t_mm_item_type t2 on t2.id = t1.itemtypeid
143         LEFT JOIN t_mm_item_status t3 on t3.item_id = t1.id
144         <where>
145             <if test="ITEMID != null and ITEMID != ''">
146                 AND t1.id=#{ITEMID}
147             </if>
148             <if test="ITEMNO != null and ITEMNO != ''">
149                 t1.itemno=#{ITEMNO}
150             </if>
151         </where>
7fd198 152     </select>
153     <select id="getMergeItemByItemId" parameterType="map" resultMap="MergeItemVO">
154         SELECT t1.id,
155                t1.itemid,
156                t1.expression
157         FROM t_mm_predict_merge_item t1
158         WHERE t1.itemid = #{ITEMID}
159     </select>
160
161
162 </mapper>