CustomerDeviceFsyncCountMapper.xml
3.05 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
<?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.customer.mapper.CustomerDeviceFsyncCountMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.customer.model.CustomerDeviceFsyncCount" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="count" property="count" jdbcType="INTEGER" />
<result column="active_sum" property="activeSum" jdbcType="INTEGER" />
<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" />
<result column="sales_sum" property="salesSum" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.customer.dto.CustomerDeviceFsyncCountDTO" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, merchant_id, merchant_name, count, active_sum, created_by, created_date, updated_by,sales_sum,
updated_date, deleted_flag
</sql>
<update id="updateByMerchantId" parameterType="cn.com.glsx.dj.customer.model.CustomerDeviceFsyncCount">
update dj_customer_device_fsync_count
<set>
<if test="count != null">
`count` = #{count},
</if>
<if test="activeSum != null">
active_sum = #{activeSum},
</if>
<if test="salesSum != null">
sales_sum = #{salesSum},
</if>
<if test="updatedBy != null and updatedBy != ''">
updated_by = #{updatedBy},
</if>
<if test="updatedDate != null">
updated_date = #{updatedDate},
</if>
<if test="deletedFlag != null and deletedFlag != ''">
deleted_flag = #{deletedFlag},
</if>
</set>
<where>
merchant_id = #{merchantId}
</where>
</update>
<select id="exists" parameterType="java.lang.Long" resultType="java.lang.Long">
SELECT merchant_id FROM dj_customer_device_fsync_count
<where>
deleted_flag = 'N'
and merchant_id = #{merchantId}
</where>
</select>
<select id="listByPage" parameterType="cn.com.glsx.dj.customer.dto.CustomerDeviceFsyncCountDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List"/>
from dj_customer_device_fsync_count
<where>
deleted_flag = 'N'
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
<if test="merchantName != null">
and merchant_name like CONCAT('%',#{merchantName, jdbcType=VARCHAR},'%')
</if>
</where>
order by updated_date desc
</select>
</mapper>