zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
commit | author | age
a18bfa 1 <?xml version="1.0" encoding="UTF-8" ?>
Z 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.changhong.epc.tenant.mapper.tenant.system.ErrSystemMsgMapper">
4     <resultMap type="com.changhong.epc.bean.tenant.system.ErrSystemMsg" id="errSystemMsgTYPE">
5         <result property="mdName" column="md_name"/>
6         <result property="errType" column="err_type"/>
7     </resultMap>
8     
9     <resultMap type="com.changhong.epc.bean.tenant.system.ErrSystemMsg" id="errSystemPageSql">
10         <result property="id" column="id"/>
11         <result property="mdName" column="md_name"/>
12         <result property="mdCode" column="md_code"/>
13         <result property="viewMsg" column="view_msg"/>
14         <result property="errType" column="err_type"/>
15         <result property="errFlag" column="err_flag"/>
16         <result property="mvVal" column="mv_val"/>
17         <result property="Def1" column="def1"/>
18         <result property="Def2" column="def2"/>
19         <result property="Def3" column="def3"/>
20         <result property="Def4" column="def4"/>
21         <result property="Def5" column="def5"/>
22         <result property="insP" column="ins_p"/>
23         <result property="insT" column="ins_t"/>
24         <result property="updP" column="upd_p"/>
25         <result property="updT" column="upd_t"/>
26         <result property="dataStart" column="data_start"/>
27         <result property="orderCode" column="orderCode"/>
28         <result property="formId" column="formId"/>
29         <result property="dataRowNum" column="dataRowNum"/>
30         <result property="formName" column="formName"/>
31     </resultMap>
32     <sql id="errSystemMsgSql">
33         id,md_name,md_code,
34         view_msg,err_type,err_flag,
35         mv_val,def1,def2,
36         def3,def4,def5,
37         ins_p,ins_t,upd_p,
38         upd_t,data_start
39     </sql>
40     <select id="selectType" resultMap="errSystemMsgTYPE">
41         SELECT
42             md_name,
43             err_type
44         FROM
45             epc_err_system_msg_{rule}
46         WHERE
47             epc_err_system_msg_{rule} .md_name != 'null'
48         AND epc_err_system_msg_{rule} .err_type != 'null'
49         GROUP BY
50             md_name,
51             err_type
52     </select>
53         
54     <select id="selectByTypePage" resultMap="errSystemPageSql">
55         SELECT
56         id,md_name,md_code,
57         view_msg,err_type,err_flag,
58         mv_val,def1,def2,
59         def3,def4,def5,
60         ins_p,ins_t,upd_p,
61         upd_t,data_start,orderCode,dataRowNum,formId,
62         (select f_name from epc_cost_from_mapping_{rule} where f_id = formId LIMIT 1) formName
63         FROM
64         epc_err_system_msg_{rule}
65         <trim prefix="WHERE" prefixOverrides="AND | OR">
66             <if test="err.errType!=null">
67                 AND err_type = #{err.errType}
68             </if>    
69             <if test="err.errFlag!=null" >
70                 AND err_flag = #{err.errFlag}
71             </if>
72
73         </trim>
74         ORDER BY  ins_t desc,formId DESC
75     </select>
76     
77     <update id="updateFlag">
78         update epc_err_system_msg_{rule}  SET err_flag=10
79         WHERE id=#{id}
80     </update>
81     
82 </mapper>