CollisionInfoMapper.xml
7.84 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?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.com.glsx.entmicro.mapper.CollisionInfoMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.collision.CollisionInfo" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="collision_time" property="collisionTime" jdbcType="TIMESTAMP" />
<result column="collision_type" property="collisionType" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="longitude" property="longitude" jdbcType="VARCHAR" />
<result column="latitude" property="latitude" jdbcType="VARCHAR" />
<result column="follow_status" property="followStatus" jdbcType="INTEGER" />
<result column="follow_result" property="followResult" jdbcType="INTEGER" />
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP" />
<result column="follow_remark" property="followRemark" jdbcType="VARCHAR" />
<result column="task_id" property="taskId" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="INTEGER" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="CollisionInfoMap" type="cn.com.glsx.entmicro.model.response.collision.CollisionInfoRpcResponse">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="collision_time" property="collisionTime" jdbcType="TIMESTAMP" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="follow_status" property="followStatus" jdbcType="INTEGER" />
<result column="follow_result" property="followResult" jdbcType="INTEGER" />
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP" />
<result column="follow_remark" property="followRemark" jdbcType="VARCHAR" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="sn_type" property="snType" jdbcType="INTEGER" />
<result column="customer_name" property="customerName" jdbcType="VARCHAR" />
<result column="customer_phone" property="customerPhone" jdbcType="VARCHAR" />
<result column="license_plate" property="licensePlate" jdbcType="VARCHAR" />
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="CollisionDetailInfoMap" type="cn.com.glsx.entmicro.model.response.collision.CollisionDetailInfoRpcResponse">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sn" property="sn" jdbcType="VARCHAR" />
<result column="collision_time" property="collisionTime" jdbcType="TIMESTAMP" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="follow_status" property="followStatus" jdbcType="INTEGER" />
<result column="follow_result" property="followResult" jdbcType="INTEGER" />
<result column="follow_time" property="followTime" jdbcType="TIMESTAMP" />
<result column="follow_remark" property="followRemark" jdbcType="VARCHAR" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="merchant_name" property="merchantName" jdbcType="VARCHAR" />
<result column="sn_type" property="snType" jdbcType="INTEGER" />
<result column="customer_name" property="customerName" jdbcType="VARCHAR" />
<result column="customer_phone" property="customerPhone" jdbcType="VARCHAR" />
<result column="license_plate" property="licensePlate" jdbcType="VARCHAR" />
<result column="stand_no" property="standNo" jdbcType="VARCHAR" />
<result column="vehicle_sub_brand_name" property="vehicleSubBrandName" jdbcType="VARCHAR" />
<result column="vehicle_series_name" property="vehicleSeriesName" jdbcType="VARCHAR" />
<result column="task_id" property="taskId" jdbcType="VARCHAR" />
<collection property="mediaDetailList" ofType="cn.com.glsx.entmicro.model.response.collision.CollisionMediaDetail">
<result column="media_type" property="mediaType" jdbcType="VARCHAR" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
</collection>
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, sn, collision_time, collision_type, address, longitude, latitude, follow_status,
follow_result, follow_time, follow_remark, task_id, del_flag, created_by, created_time,
updated_by, updated_time
</sql>
<select id="listCollisionInfo" parameterType="cn.com.glsx.entmicro.model.request.collision.CollisionInfoSearchRpcRequest" resultMap="CollisionInfoMap">
select sci.id ,sci.sn,sci.collision_time ,sci.address ,sci.follow_status ,sci.follow_result ,sci.follow_time ,sci.follow_remark, sci.updated_by,
scsi.merchant_id ,scsi.merchant_name ,scsi.customer_name ,scsi.customer_phone ,scsi.sn_type ,scsi.license_plate ,scsi.stand_no
from scrm_collision_info sci
left join scrm_collision_sn_info scsi on sci.sn = scsi.sn and scsi.del_flag = 0
<where>
sci.del_flag = 0
<if test="sn != null and sn != ''">
and sci.sn like '%${sn}%'
</if>
<if test="merchantName != null and merchantName != ''">
and scsi.merchant_name like '%${merchantName}%'
</if>
<if test="merchantNo != null and operate==true">
and scsi.merchant_id = #{merchantNo}
</if>
<if test="merchantId!=null and operate==false">
AND scsi.merchant_id = #{merchantId}
</if>
<if test="snType != null">
and scsi.sn_type =#{snType}
</if>
<if test="customerPhone != null and customerPhone != ''">
and scsi.customer_phone like '%${customerPhone}%'
</if>
<if test="customerName != null and customerName != ''">
and scsi.customer_name like '%${customerName}%'
</if>
<if test="licensePlate != null and licensePlate != ''">
and scsi.license_plate like '%${licensePlate}%'
</if>
<if test="standNo != null and standNo != ''">
and scsi.stand_no like '%${standNo}%'
</if>
<if test="followStatus != null">
and sci.follow_status = #{followStatus}
</if>
<if test="followResult != null">
and sci.follow_result = #{followResult}
</if>
<if test="beginFollowTime != null">
and sci.follow_time >= #{beginFollowTime}
</if>
<if test="endFollowTime != null">
and sci.follow_time <= #{endFollowTime}
</if>
</where>
order by sci.follow_time desc
</select>
<select id="getDetailById" resultMap="CollisionDetailInfoMap">
select sci.id ,sci.sn,sci.collision_time ,sci.address ,sci.follow_status ,sci.follow_result ,sci.follow_time ,sci.follow_remark, sci.updated_by,sci.task_id,
scsi.merchant_id ,scsi.merchant_name ,scsi.customer_name ,scsi.customer_phone ,scsi.sn_type ,scsi.license_plate ,scsi.stand_no,scsi.vehicle_sub_brand_name,
scsi.vehicle_series_name,scmi.file_url,scmi.media_type
from scrm_collision_info sci
left join scrm_collision_sn_info scsi on sci.sn = scsi.sn and scsi.del_flag = 0
left join scrm_collision_media_info scmi on sci.task_id = scmi.task_id and scmi.del_flag = 0
<where>
sci.del_flag = 0 and sci.id = #{id}
</where>
</select>
</mapper>