dengzedong
2024-09-13 3acc3151d842922fda223cbed8987b3fe9f83e24
提交 | 用户 | 时间
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
25     <select id="queryList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO" parameterType="map">
26         SELECT
27         TMPI.ID,
28         TMPI.ITEMNO,
29         TMPI.ITEMNAME,
30         TMPI.ITEMTYPEID,
31         TMIT.ITEMTYPENAME,
32         TMPI.GRANULARITY,
33         TMPI.ISFUSE,
34         TMPI.WORKCHECKED,
35         TDMI.MODULEID,
36         TDMI.ITEMORDER,
37         TDMI.STATUS,
38         TDMI.CATEGORYID,
39         TMIO.POINTID,
40         TMIO.TAGNAME,
41         TMIO.RESULTTABLEID,
42         TMRT.TABLENAME
43         FROM T_MM_PREDICT_ITEM TMPI
44         LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
45         LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
46         LEFT JOIN T_MM_ITEM_OUTPUT TMIO ON TMIO.ITEMID = TMPI.ID
47         LEFT JOIN T_MM_RESULT_TABLE TMRT ON TMRT.ID = TMIO.RESULTTABLEID
48         WHERE 1 = 1
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 TDMI.STATUS = #{params.status}
63         </if>
64         ORDER BY TMPI.CREATE_TIME DESC
65     </select>
66
67     <select id="getByModuleId" parameterType="map" resultMap="ItemVO">
68         SELECT t1.id,
69                t1.itemno,
70                t1.itemname,
71                t3.itemtypename,
72                t1.predictlength,
73                t1.granularity,
74                t1.status,
75                t1.isfuse,
76                t1.workchecked,
77                t1.unittransfactor
78         FROM t_mm_predict_item t1,
79              t_dm_module_item t2,
80              t_mm_item_type t3
81         WHERE t1.id = t2.itemid
82           AND t1.itemtypeid = t3.id
83           AND t2.moduleid = #{MODULEID}
84           AND t2.status = 1
85           AND t1.status = 1
86         ORDER BY t2.itemorder
87     </select>
88
89     <select id="getItem" parameterType="map" resultMap="ItemVO">
90         SELECT
91         t1.id,
92         t1.itemno ,
93         t1.itemname ,
94         t1.predictlength ,
95         t2.itemtypename,
96         t1.granularity,
97         t1.status,
98         t1.isfuse,
99         t1.predictphase,
100         t1.workchecked
101         FROM
102         ${TABLESCHEMA}.t_mm_predict_item t1,
103         ${TABLESCHEMA}.t_mm_item_type t2
104         WHERE t1.itemtypeid=t2.id
105         <if test="ITEMID != null and ITEMID != ''">
106             AND t1.id=#{ITEMID}
107         </if>
108         <if test="ITEMNO != null and ITEMNO != ''">
109             t1.itemno=#{ITEMNO}
110         </if>
111     </select>
112     <select id="getMergeItemByItemId" parameterType="map" resultMap="MergeItemVO">
113         SELECT t1.id,
114                t1.itemid,
115                t1.expression
116         FROM t_mm_predict_merge_item t1
117         WHERE t1.itemid = #{ITEMID}
118     </select>
119
120
121 </mapper>