DataDictionaryDao.xml
1.88 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
<?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="com.diligrp.assistant.data.dao.DataDictionaryDao">
<resultMap id="DataDictionaryMap" type="com.diligrp.assistant.data.model.DataDictionary">
<id column="id" property="id"/>
<result column="type" property="type"/>
<result column="group_code" property="groupCode"/>
<result column="code" property="code"/>
<result column="name" property="name"/>
<result column="value" property="value"/>
<result column="description" property="description"/>
<result column="created_time" property="createdTime"/>
<result column="modified_time" property="modifiedTime"/>
</resultMap>
<insert id="insertDataDictionary" parameterType="com.diligrp.assistant.data.model.DataDictionary">
INSERT INTO data_dictionary
(type, group_code, code, name, value, description, created_time, modified_time)
VALUES
(#{type}, #{groupCode}, #{code}, #{name}, #{value}, #{description}, #{createdTime}, #{modifiedTime})
</insert>
<select id="findDataDictionaryByCode" resultMap="DataDictionaryMap">
SELECT * FROM data_dictionary WHERE group_code = #{groupCode} AND code = #{code}
</select>
<select id="findDataDictionaries" resultMap="DataDictionaryMap">
SELECT * FROM data_dictionary WHERE group_code = #{groupCode}
ORDER BY id
</select>
<update id="updateDataDictionary">
UPDATE data_dictionary SET value = #{value}, modified_time = #{modifiedTime}
<if test="name != null">
, name = #{name}
</if>
<if test="description != null">
, description = #{description}
</if>
WHERE group_code = #{groupCode} AND code = #{code}
</update>
</mapper>