SysDictDataMapper.xml
5.04 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?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.base.modules.mapper.SysDictDataMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.base.modules.entity.SysDictData">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="dict_sort" jdbcType="INTEGER" property="dictSort"/>
<result column="dict_label" jdbcType="VARCHAR" property="dictLabel"/>
<result column="dict_value" jdbcType="VARCHAR" property="dictValue"/>
<result column="dict_type" jdbcType="VARCHAR" property="dictType"/>
<result column="is_default" jdbcType="CHAR" property="isDefault"/>
<result column="enable_status" jdbcType="INTEGER" property="enableStatus"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.base.modules.model.DictDataDTO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="dict_sort" jdbcType="INTEGER" property="dictSort"/>
<result column="dict_label" jdbcType="VARCHAR" property="dictLabel"/>
<result column="dict_value" jdbcType="VARCHAR" property="dictValue"/>
<result column="dict_type" jdbcType="VARCHAR" property="dictType"/>
<result column="is_default" jdbcType="CHAR" property="isDefault"/>
<result column="enable_status" jdbcType="INTEGER" property="enableStatus"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, dict_sort, dict_label, dict_value, dict_type, is_default, enable_status, del_flag,
created_by, created_date, updated_by, updated_date, remark
</sql>
<select id="selectByType" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where dict_type = #{type}
and del_flag = 0
</select>
<select id="selectByType2" resultMap="DTOResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where dict_type = #{type}
and del_flag = 0
</select>
<select id="selectByTypeWithDeleted" resultMap="DTOResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where dict_type = #{type}
</select>
<select id="selectByTypeAndLabelWithDeleted" resultMap="DTOResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where dict_type = #{type}
and dict_label = #{label}
</select>
<select id="selectList" resultMap="DTOResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where del_flag = 0
and dict_type = #{type}
<if test="tag != null and tag != ''">
and dict_label LIKE CONCAT('%',#{tag},'%')
</if>
<if test="status != null">
and enable_status = #{status}
</if>
<if test="sDate != null and sDate != '' and eDate != null and eDate != ''">
and DATE_FORMAT(created_date, '%Y-%m-%d') >= #{sDate}
and DATE_FORMAT(created_date, '%Y-%m-%d') <= #{eDate}
</if>
order by id desc
</select>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where id = #{id}
and del_flag = 0
</select>
<update id="logicDeleteById">
update t_dict_data
set del_flag = -1
where id = #{id}
</update>
<select id="findByDict" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_dict_data
where del_flag = 0
<if test="sysDictData != null">
<if test="sysDictData.dictLabel != null and sysDictData.dictLabel != ''">
and dict_label = #{sysDictData.dictLabel}
</if>
<if test="sysDictData.dictType != null and sysDictData.dictType != ''">
and dict_type = #{sysDictData.dictType}
</if>
<if test="sysDictData.dictValue != null and sysDictData.dictValue != ''">
and dict_value #{sysDictData.dictValue}
</if>
</if>
</select>
</mapper>