InsuranceAddDeviceConfigMapper.xml
4.25 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
<?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.insure.mapper.InsuranceAddDeviceConfigMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.insure.model.InsuranceAddDeviceConfig">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="province_id" jdbcType="INTEGER" property="provinceId" />
<result column="province_name" jdbcType="VARCHAR" property="provinceName" />
<result column="car_brand_id" jdbcType="INTEGER" property="carBrandId" />
<result column="car_brand_name" jdbcType="VARCHAR" property="carBrandName" />
<result column="car_series_id" jdbcType="INTEGER" property="carSeriesId" />
<result column="car_series_name" jdbcType="VARCHAR" property="carSeriesName" />
<result column="min_device_count" jdbcType="TINYINT" property="minDeviceCount" />
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" />
<result column="delete_flag" jdbcType="CHAR" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
id, province_id, province_name, car_brand_id, car_brand_name, car_series_id, car_series_name,
min_device_count, created_by, created_date, updated_by, updated_date, delete_flag
</sql>
<select id="list" parameterType="cn.com.glsx.dj.insure.model.InsuranceAddDeviceConfig" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dj_insurance_add_device_config
<where>
delete_flag = 'N'
<if test="id != null">
and id = #{id}
</if>
<if test="provinceId != null">
and province_id = #{provinceId}
</if>
<if test="carBrandId != null">
and car_brand_id = #{carBrandId}
</if>
<if test="carSeriesId != null">
and car_series_id = #{carSeriesId}
</if>
</where>
</select>
<insert id="insert" parameterType="cn.com.glsx.dj.insure.model.InsuranceAddDeviceConfig" useGeneratedKeys="true" keyProperty="id">
insert into dj_insurance_add_device_config (<include refid="Base_Column_List" />)
values (#{id,jdbcType=INTEGER}, #{provinceId,jdbcType=INTEGER}, #{provinceName,jdbcType=VARCHAR},
#{carBrandId,jdbcType=INTEGER}, #{carBrandName,jdbcType=VARCHAR}, #{carSeriesId,jdbcType=INTEGER},
#{carSeriesName,jdbcType=VARCHAR}, #{minDeviceCount,jdbcType=TINYINT},
#{createdBy,jdbcType=VARCHAR}, #{createdDate,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
#{updatedDate,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=CHAR})
</insert>
<update id="update" parameterType="cn.com.glsx.dj.insure.model.InsuranceAddDeviceConfig">
update dj_insurance_add_device_config
<set>
<if test="provinceId != null">
province_id = #{provinceId,jdbcType=INTEGER},
</if>
<if test="provinceName != null">
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if test="carBrandId != null">
car_brand_id = #{carBrandId,jdbcType=INTEGER},
</if>
<if test="carBrandName != null">
car_brand_name = #{carBrandName,jdbcType=VARCHAR},
</if>
<if test="carSeriesId != null">
car_series_id = #{carSeriesId,jdbcType=INTEGER},
</if>
<if test="carSeriesName != null">
car_series_name = #{carSeriesName,jdbcType=VARCHAR},
</if>
<if test="minDeviceCount != null">
min_device_count = #{minDeviceCount,jdbcType=TINYINT},
</if>
<if test="createdBy != null">
created_by = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdDate != null">
created_date = #{createdDate,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
updated_by = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedDate != null">
updated_date = #{updatedDate,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>