zhubaomin
4 天以前 02faa2bb05b3cdb50ee1f56ae4c9a1282e9f9c44
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?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.dy.pipIrrGlobal.daoSe.SeManagerCardMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    <!--@Table se_manager_card-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="protocol" jdbcType="VARCHAR" property="protocol" />
    <result column="card_addr" jdbcType="VARCHAR" property="cardAddr" />
    <result column="card_num" jdbcType="VARCHAR" property="cardNum" />
    <result column="card_type" jdbcType="TINYINT" property="cardType" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, protocol, card_addr, card_num, card_type, create_time, remarks, order_no
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from se_manager_card
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_manager_card
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    insert into se_manager_card (id, protocol, card_addr, 
      card_num, card_type, create_time, 
      remarks, order_no)
    values (#{id,jdbcType=BIGINT}, #{protocol,jdbcType=VARCHAR}, #{cardAddr,jdbcType=VARCHAR}, 
      #{cardNum,jdbcType=VARCHAR}, #{cardType,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, 
      #{remarks,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    insert into se_manager_card
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="protocol != null">
        protocol,
      </if>
      <if test="cardAddr != null">
        card_addr,
      </if>
      <if test="cardNum != null">
        card_num,
      </if>
      <if test="cardType != null">
        card_type,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="orderNo != null">
        order_no,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="protocol != null">
        #{protocol,jdbcType=VARCHAR},
      </if>
      <if test="cardAddr != null">
        #{cardAddr,jdbcType=VARCHAR},
      </if>
      <if test="cardNum != null">
        #{cardNum,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        #{cardType,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="orderNo != null">
        #{orderNo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    update se_manager_card
    <set>
      <if test="protocol != null">
        protocol = #{protocol,jdbcType=VARCHAR},
      </if>
      <if test="cardAddr != null">
        card_addr = #{cardAddr,jdbcType=VARCHAR},
      </if>
      <if test="cardNum != null">
        card_num = #{cardNum,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        card_type = #{cardType,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="orderNo != null">
        order_no = #{orderNo,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeManagerCard">
    <!--@mbg.generated-->
    update se_manager_card
    set protocol = #{protocol,jdbcType=VARCHAR},
      card_addr = #{cardAddr,jdbcType=VARCHAR},
      card_num = #{cardNum,jdbcType=VARCHAR},
      card_type = #{cardType,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      remarks = #{remarks,jdbcType=VARCHAR},
      order_no = #{orderNo,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
 
  <!--根据行政区划串模糊查询管理卡编号-->
  <select id="getManagerCardNumOfMax"  resultType="java.lang.String">
    SELECT card_num
    FROM se_manager_card
    WHERE card_num LIKE CONCAT(#{areaCode},'%')
    ORDER BY card_num desc
    LIMIT 0,1
  </select>
 
  <!--充值机用获取管理卡信息-->
  <select id="getTermManagerCardInfo" resultType="com.dy.pipIrrGlobal.voSe.VoTermCard">
    SELECT
      card_num AS cardNum,
      card_type AS cardType,
      NULL AS money,
      NULL AS state,
      NULL AS userName,
      NULL AS clientNum,
      NULL AS phone,
      NULL AS address,
      NULL AS lastRechargeTime,
      card.protocol AS cardcardAgreement
    FROM se_manager_card card
    WHERE card.card_addr = #{cardAddr}
      LIMIT 1
  </select>
</mapper>