ConfigMapper.xml
3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.system.mapper.ConfigMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.system.model.Config" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="conf_name" property="confName" jdbcType="VARCHAR" />
<result column="conf_key" property="confKey" jdbcType="VARCHAR" />
<result column="conf_value" property="confValue" jdbcType="VARCHAR" />
<result column="conf_group" property="confGroup" jdbcType="VARCHAR" />
<result column="conf_default" property="confDefault" jdbcType="CHAR" />
<result column="conf_description" property="confDescription"/>
<result column="conf_order" property="confOrder" jdbcType="SMALLINT" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, conf_name, conf_key, conf_value, conf_group, conf_default,conf_description, conf_order, created_by,
created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="list" parameterType="cn.com.glsx.dj.system.dto.ConfigDTO" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from dj_system_configure
<where>
deleted_flag='N'
<if test="confName != null and confName !=''">
and conf_name = #{confName}
</if>
<if test="confKey != null and confKey !=''">
and conf_key = #{confKey}
</if>
<if test="confValue != null and confValue !=''">
and conf_value = #{confValue}
</if>
<if test="confGroup != null and confGroup !=''">
and conf_group = #{confGroup}
</if>
<if test="confDefault != null and confDefault !=''">
and conf_default = #{confDefault}
</if>
<if test="confGroupList != null and confGroupList.size() > 0">
and conf_group in
<foreach collection="confGroupList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="confKeyList != null and confKeyList.size() > 0">
and conf_key in
<foreach collection="confKeyList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by conf_order desc
</select>
<update id="updateConfig" parameterType="cn.com.glsx.dj.system.model.Config">
UPDATE dj_system_configure
<set>
<if test="confValue != null and confValue !=''">
conf_value = #{confValue},
</if>
<if test="confName != null and confName !=''">
conf_name = #{confName},
</if>
<if test="confGroup != null and confGroup !=''">
conf_group = #{confGroup},
</if>
<if test="confDefault != null and confDefault !=''">
conf_default = #{confDefault},
</if>
<if test="updatedDate != null">
updated_date = #{updatedDate},
</if>
</set>
where conf_key = #{confKey}
</update>
<update id="deleteByGroupAndNotInKeys" parameterType="cn.com.glsx.dj.system.dto.ConfigDTO">
update dj_system_configure set deleted_flag='D',updated_date=#{updatedDate},updated_by=#{updatedBy}
where deleted_flag='N' and conf_group=#{confGroup}
<if test="confKeyList != null and confKeyList.size() > 0">
and conf_key not in
<foreach collection="confKeyList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
</mapper>