TdCCarCheckRecordSMapper.xml
5 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
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
<?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.TdCCarCheckRecordSMapper">
<resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdCCarCheckRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="car_number" jdbcType="VARCHAR" property="carNumber" />
<result column="cust_id" jdbcType="VARCHAR" property="custId" />
<result column="phone_num" jdbcType="VARCHAR" property="phoneNum" />
<result column="cer_picture_path" jdbcType="VARCHAR" property="cerPicturePath" />
<result column="car_shelf_num" jdbcType="VARCHAR" property="carShelfNum" />
<result column="car_engine_num" jdbcType="VARCHAR" property="carEngineNum" />
<result column="check_state" jdbcType="INTEGER" property="checkState" />
<result column="check_remark" jdbcType="VARCHAR" property="checkRemark" />
<result column="data_status" jdbcType="INTEGER" property="dataStatus" />
<result column="oper_id" jdbcType="INTEGER" property="operId" />
<result column="oper_time" jdbcType="TIMESTAMP" property="operTime" />
<result column="oper_name" jdbcType="VARCHAR" property="operName" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, car_number, cust_id, phone_num, cer_picture_path, car_shelf_num, car_engine_num,
check_state, check_remark, data_status, oper_id, oper_time, oper_name
</sql>
<select id="queryTdCCarCheckRecord" parameterType="com.zteits.clouds.api.dto.pay.param.TdCCarCheckRecordRequest"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from td_c_car_check_record
<where>
data_status = 1
<if test="carNumber != null and carNumber !='' ">
and car_number like concat('%',#{carNumber},'%')
</if>
<if test="phoneNum != null and phoneNum !='' ">
and phone_num = #{phone_num}
</if>
<if test="checkStartDate != null ">
and oper_time >= #{checkStartDate}
</if>
<if test="checkEndDate != null ">
and oper_time <= #{checkEndDate}
</if>
order by oper_time desc
</where>
</select>
<!-- 通过车牌号查询审核记录最新一条信息 -->
<select id="queryLastTdCCarCheckRecord" parameterType="com.zteits.clouds.api.dto.pay.param.TdCCarCheckRecordRequest"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from td_c_car_check_record
<where>
data_status = 1
and car_number = #{carNumber}
and cust_id = #{custId}
<if test="carCheckType != null ">
and car_check_type = #{carCheckType}
</if>
order by oper_time desc
limit 1
</where>
</select>
</mapper>