ParkCardSmapper.xml
2.88 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
<?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.ParkCardSmapper">
<resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdBParkCard" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="card_no" property="cardNo" jdbcType="VARCHAR" />
<result column="card_name" property="cardName" jdbcType="VARCHAR" />
<result column="car_type" property="carType" jdbcType="INTEGER" />
<result column="card_type" property="cardType" jdbcType="INTEGER" />
<result column="valid_unit" property="validUnit" jdbcType="INTEGER" />
<result column="valid_num" property="validNum" jdbcType="INTEGER" />
<result column="price" property="price" jdbcType="BIGINT" />
<result column="eff_date" property="effDate" jdbcType="TIMESTAMP" />
<result column="exp_date" property="expDate" jdbcType="TIMESTAMP" />
<result column="card_status" property="cardStatus" jdbcType="INTEGER" />
<result column="data_state" property="dataState" jdbcType="INTEGER" />
<result column="create_empid" property="createEmpid" jdbcType="BIGINT" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
<result column="modify_empid" property="modifyEmpid" jdbcType="BIGINT" />
<result column="modify_date" property="modifyDate" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.zteits.pay.domain.TdBParkCard" extends="BaseResultMap" >
<result column="remark" property="remark" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, card_no, card_name, car_type, card_type, valid_unit, valid_num, price, eff_date,
exp_date, card_status, data_state, create_empid, create_date, modify_empid, modify_date
</sql>
<sql id="Blob_Column_List" >
remark
</sql>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from td_b_park_card
where id = #{id,jdbcType=BIGINT}
</select>
<select id="queryParkCardByCardNos" resultMap="ResultMapWithBLOBs" parameterType="java.util.List">
SELECT
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
FROM td_b_park_card
WHERE data_state = 1
AND card_no IN
<foreach collection="cardNos" index="index" item="cardNo" open="(" close=")" separator=",">
#{cardNo}
</foreach>
AND eff_date <= now()
AND exp_date >= now()
<if test="cardStatus != null">
AND card_status = #{cardStatus}
</if>
</select>
</mapper>