TdCCustScoreDetailSMapper.xml
2.21 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
<?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.zteits.pay.mapper.smapper.TdCCustScoreDetailSMapper">
<resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdCCustScoreDetail">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="cust_id" jdbcType="VARCHAR" property="custId" />
<result column="score" jdbcType="INTEGER" property="score" />
<result column="score_desc" jdbcType="VARCHAR" property="scoreDesc" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="eff_date" jdbcType="TIMESTAMP" property="effDate" />
<result column="exp_date" jdbcType="TIMESTAMP" property="expDate" />
<result column="score_state" jdbcType="INTEGER" property="scoreState" />
<result column="resource_big_type" jdbcType="INTEGER" property="resourceBigType" />
<result column="resource" jdbcType="INTEGER" property="resource" />
<result column="out_no" jdbcType="VARCHAR" property="outNo" />
<result column="data_state" jdbcType="INTEGER" property="dataState" />
<result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
<result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
<result column="org_id" jdbcType="BIGINT" property="orgId" />
<result column="org_name" jdbcType="VARCHAR" property="orgName" />
</resultMap>
<sql id="Base_Column_List">
id, cust_id, score, score_desc, remark, eff_date, exp_date, score_state, resource_big_type,
resource, out_no, data_state, create_empid, create_date, modfiy_empid, modfiy_date,
org_id, org_name
</sql>
<select id="queryCustSurplusScore" parameterType="com.zteits.pay.domain.TdCCustScoreDetail" resultType="java.lang.Integer">
SELECT
IFNULL(SUM(score), 0)
FROM
td_c_cust_score_detail
WHERE
1 = 1
AND data_state = 1
AND score_state = 1
AND cust_id = #{custId}
AND (exp_date >= SYSDATE() or exp_date is null)
</select>
</mapper>