OrderPointsMapper.xml
3.77 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
<?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.runsa.crmapp.points.mapper.OrderPointsMapper">
<resultMap id="BaseResultMap" type="cn.runsa.crmapp.points.entity.OrderPoints">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="RCPT_ID" jdbcType="VARCHAR" property="rcptId" />
<result column="BLC_ACT" jdbcType="BIGINT" property="blcAct" />
<result column="ACT_ID" jdbcType="BIGINT" property="actId" />
<result column="PNT_TYPE" jdbcType="VARCHAR" property="pntType" />
<result column="PNT_VAL" jdbcType="DOUBLE" property="pntVal" />
</resultMap>
<resultMap id="PointsMap" type="cn.runsa.crmapp.points.entity.support.Points">
<result column="BLC_ACT" jdbcType="BIGINT" property="blcAct" />
<result column="ACT_ID" jdbcType="BIGINT" property="actId" />
<result column="PNT_TYPE" jdbcType="VARCHAR" property="pntType" />
<result column="PNT_VAL" jdbcType="DOUBLE" property="pntVal" />
</resultMap>
<insert id="insert" parameterType="cn.runsa.crmapp.points.entity.OrderPoints">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into crm_order_points (`RCPT_ID`, `BLC_ACT`, `ACT_ID`,
`PNT_TYPE`, `PNT_VAL`)
values (#{rcptId,jdbcType=VARCHAR}, #{blcAct,jdbcType=BIGINT}, #{actId,jdbcType=BIGINT},
#{pntType,jdbcType=VARCHAR}, #{pntVal,jdbcType=DOUBLE})
</insert>
<insert id="insertSelective" parameterType="cn.runsa.crmapp.points.entity.OrderPoints">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into crm_order_points
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="rcptId != null">
`RCPT_ID`,
</if>
<if test="blcAct != null">
`BLC_ACT`,
</if>
<if test="actId != null">
`ACT_ID`,
</if>
<if test="pntType != null">
`PNT_TYPE`,
</if>
<if test="pntVal != null">
`PNT_VAL`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="rcptId != null">
#{rcptId,jdbcType=VARCHAR},
</if>
<if test="blcAct != null">
#{blcAct,jdbcType=BIGINT},
</if>
<if test="actId != null">
#{actId,jdbcType=BIGINT},
</if>
<if test="pntType != null">
#{pntType,jdbcType=VARCHAR},
</if>
<if test="pntVal != null">
#{pntVal,jdbcType=DOUBLE},
</if>
</trim>
</insert>
<insert id="insertList" parameterType="cn.runsa.crmapp.points.entity.OrderPoints">
insert into crm_order_points (`RCPT_ID`, `BLC_ACT`, `ACT_ID`,`PNT_TYPE`, `PNT_VAL`)
values
<foreach collection="list" item="it" separator=",">
(#{it.rcptId,jdbcType=VARCHAR}, #{it.blcAct,jdbcType=BIGINT}, #{it.actId,jdbcType=BIGINT},
#{it.pntType,jdbcType=VARCHAR}, #{it.pntVal,jdbcType=DOUBLE})
</foreach>
</insert>
<select id="selectPointsList" parameterType="java.lang.String" resultMap="PointsMap">
select `BLC_ACT`, `ACT_ID`,`PNT_TYPE`, `PNT_VAL` from crm_order_points where RCPT_ID = #{id}
</select>
<select id="selectOrderPointsList" parameterType="java.lang.String" resultType="map">
SELECT o.*,s.`ACT_NAME`,t.`PNT_NAME`
FROM crm_order_points o
LEFT JOIN crm_account_set s
ON o.`ACT_ID` = s.`ACT_ID`
LEFT JOIN crm_points_type t
ON o.`PNT_TYPE` = t.`PNT_TYPE`
WHERE RCPT_ID = #{id};
</select>
<delete id="deleteByReceiptId" parameterType="java.lang.String">
DELETE FROM crm_order_points WHERE RCPT_ID = #{id}
</delete>
</mapper>