GarOrderMapper.xml
6.1 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
<?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.trash.garbage.mapper.GarOrderMapper">
<resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrder">
<id property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
<result property="garOrderUserId" column="gar_order_user_id" jdbcType="VARCHAR"/>
<result property="garOrderHandlerId" column="gar_order_handler_id" jdbcType="VARCHAR"/>
<result property="garOrderAddress" column="gar_order_address" jdbcType="VARCHAR"/>
<result property="garOrderAddressDetails" column="gar_order_address_details" jdbcType="VARCHAR"/>
<result property="garOrderContactName" column="gar_order_contact_name" jdbcType="VARCHAR"/>
<result property="garOrderTrashType" column="gar_order_trash_type" jdbcType="VARCHAR"/>
<result property="garOrderContactTel" column="gar_order_contact_tel" jdbcType="VARCHAR"/>
<result property="garOrderCompanyId" column="gar_order_company_id" jdbcType="VARCHAR"/>
<result property="garOrderCompanyName" column="gar_order_company_name" jdbcType="VARCHAR"/>
<result property="garOrderCompanyTel" column="gar_order_company_tel" jdbcType="VARCHAR"/>
<result property="garOrderHandlerStatus" column="gar_order_handler_status" jdbcType="INTEGER"/>
<result property="garOrderAgreementTime" column="gar_order_agreement_time" jdbcType="VARCHAR"/>
<result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
<result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
<result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
<result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
<result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
<result property="garReason" column="gar_reason" jdbcType="VARCHAR"/>
<result property="garCancelFlag" column="gar_cancel_flag" jdbcType="TINYINT"/>
<result property="garEvaluateFlag" column="gar_evaluate_flag" jdbcType="TINYINT"/>
<result property="garHandlerEvaluateFlag" column="gar_handler_evaluate_flag" jdbcType="TINYINT"/>
<result property="garOrderMatchFlag" column="gar_order_match_flag" jdbcType="TINYINT"/>
<result property="garLatitude" column="gar_latitude" jdbcType="DOUBLE"/>
<result property="garLongitude" column="gar_longitude" jdbcType="DOUBLE"/>
<result property="garCoordinate" column="gar_coordinate" jdbcType="DOUBLE"/>
</resultMap>
<sql id="Base_Column_List">
gar_order_id
,gar_order_user_id,gar_order_handler_id,
gar_order_address,gar_order_address_details,gar_order_contact_name,
gar_order_trash_type,gar_order_contact_tel,gar_order_company_id,
gar_order_company_name,gar_order_company_tel,gar_order_handler_status,
gar_order_agreement_time,gar_create_time,gar_update_time,
gar_create_by,gar_update_by,gar_remark,gar_reason,gar_cancel_flag,
gar_evaluate_flag,gar_handler_evaluate_flag,gar_order_match_flag,gar_coordinate,gar_longitude,gar_latitude
</sql>
<select id="queryCleanNumberByEnterpriseIds" resultType="com.trash.garbage.pojo.domain.GarOrder">
select gar_order_company_id, count(gar_order_company_id) as count
from gar_order
where gar_order_handler_status = #{status}
and gar_order_company_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
#{item}
</foreach>
group by gar_order_company_id
</select>
<select id="queryOrderListByTelWithType" resultType="com.trash.garbage.pojo.vo.GarOrderDriverVo">
SELECT
`order`.gar_order_id ,`order`.gar_order_user_id,`order`.gar_order_handler_id,`order`.gar_coordinate,
`order`.gar_order_address,`order`.gar_order_address_details,`order`.gar_order_contact_name,`order`.gar_longitude,
`order`.gar_order_trash_type,`order`.gar_order_contact_tel,`order`.gar_order_company_id,`order`.gar_latitude,
`order`.gar_order_company_name,`order`.gar_order_company_tel,`order`.gar_order_match_flag,
`order`.gar_order_agreement_time,`order`.gar_remark,`order`.gar_handler_evaluate_flag,`order`.gar_order_handler_status gar_order_status,
`handler`.gar_order_status gar_order_handler_status,`handler`.gar_cancel_flag,`handler`.gar_reason
FROM gar_order `order`
INNER JOIN gar_order_match_handler `handler` ON `order`.gar_order_id = `handler`.gar_order_id
<where>
`handler`.gar_order_handler_tel = #{garUserTel}
<if test="type != null">
AND `handler`.gar_order_status = #{type}
</if>
<if test="cancelFlag != null">
AND `handler`.gar_cancel_flag = #{cancelFlag}
</if>
</where>
</select>
<select id="queryOrderByTelWithType" resultType="com.trash.garbage.pojo.vo.GarOrderDriverVo">
SELECT
`order`.gar_order_id ,`order`.gar_order_user_id,`order`.gar_order_handler_id,
`order`.gar_order_address,`order`.gar_order_address_details,`order`.gar_order_contact_name,
`order`.gar_order_trash_type,`order`.gar_order_contact_tel,`order`.gar_order_company_id,
`order`.gar_order_company_name,`order`.gar_order_company_tel,`order`.gar_order_match_flag,
`order`.gar_order_agreement_time,`order`.gar_remark,`order`.gar_handler_evaluate_flag,`order`.gar_order_handler_status gar_order_status,
`handler`.gar_order_status gar_order_handler_status,`handler`.gar_cancel_flag,`handler`.gar_reason,`handler`.gar_handler_car_code
FROM gar_order `order`
INNER JOIN gar_order_match_handler `handler` ON `order`.gar_order_id = `handler`.gar_order_id AND `order`.gar_order_id = #{orderId}
<where>
`handler`.gar_order_handler_tel = #{garUserTel}
<if test="cancelFlag != null">
AND `handler`.gar_cancel_flag = #{cancelFlag}
</if>
</where>
</select>
</mapper>