WorkOrderMapper.xml
5.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
<?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.stdinterface.modules.mapper.WorkOrderMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.stdinterface.modules.entity.WorkOrder">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
<result column="partner_order_no" jdbcType="VARCHAR" property="partnerOrderNo"/>
<result column="order_source" jdbcType="VARCHAR" property="orderSource"/>
<result column="ref_order_id" jdbcType="INTEGER" property="refOrderId"/>
<result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
<result column="shop_contactor" jdbcType="VARCHAR" property="shopContactor"/>
<result column="shop_telephone" jdbcType="VARCHAR" property="shopTelephone"/>
<result column="shop_address" jdbcType="VARCHAR" property="shopAddress"/>
<result column="service_type" jdbcType="VARCHAR" property="serviceType"/>
<result column="service_time" jdbcType="TIMESTAMP" property="serviceTime"/>
<result column="service_period" jdbcType="TINYINT" property="servicePeriod"/>
<result column="service_expire_time" jdbcType="TIMESTAMP" property="serviceExpireTime"/>
<result column="service_apm" jdbcType="VARCHAR" property="serviceApm"/>
<result column="area" jdbcType="VARCHAR" property="area"/>
<result column="province" jdbcType="VARCHAR" property="province"/>
<result column="city" jdbcType="VARCHAR" property="city"/>
<result column="district" jdbcType="VARCHAR" property="district"/>
<result column="service_address" jdbcType="VARCHAR" property="serviceAddress"/>
<result column="service_linker" jdbcType="VARCHAR" property="serviceLinker"/>
<result column="service_linker_phone" jdbcType="VARCHAR" property="serviceLinkerPhone"/>
<result column="service_explain" jdbcType="VARCHAR" property="serviceExplain"/>
<result column="need_install" jdbcType="VARCHAR" property="needInstall"/>
<result column="need_insure" jdbcType="VARCHAR" property="needInsure"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="TINYINT" property="status"/>
<result column="service_provider" jdbcType="VARCHAR" property="serviceProvider"/>
<result column="service_provider_phone" jdbcType="VARCHAR" property="serviceProviderPhone"/>
<result column="mechanic_name" jdbcType="VARCHAR" property="mechanicName"/>
<result column="mechanic_phone" jdbcType="VARCHAR" property="mechanicPhone"/>
<result column="finished_remark" jdbcType="VARCHAR" property="finishedRemark"/>
<result column="notify_target" jdbcType="VARCHAR" property="notifyTarget"/>
<result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, order_no, partner_order_no, order_source, ref_order_id, shop_name, shop_contactor, shop_telephone, shop_address,
service_type, service_time, service_period, service_expire_time, service_apm, service_linker, service_linker_phone,
service_address, service_explain, need_install, need_insure, remark, `status`, area, province, city, district,
service_provider, service_provider_phone, mechanic_name, mechanic_phone, finished_remark, notify_target,
del_flag, created_date, created_by, updated_date, updated_by
</sql>
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_workorder
where del_flag = 0
and id = #{id}
</select>
<select id="selectByOrderNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_workorder
where del_flag = 0
and order_no = #{orderNo}
</select>
<select id="selectByRefOrderIdAndPartnerOrderNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_workorder
where del_flag = 0
and ref_order_id = #{refOrderId}
and partner_order_no = #{partnerOrderNo}
</select>
<select id="selectPartnerWorkOrdersByPartnerOrderNo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_workorder
where del_flag = 0
and order_source = #{orderSource}
and service_type = #{serviceType}
and partner_order_no = #{partnerOrderNo}
</select>
<select id="selectCompletedPartnerWorkOrdersByVin" resultMap="BaseResultMap">
select tw.*
from t_workorder tw
left join t_workorder_vehicle twv on twv.workorder_id = tw.id
where tw.del_flag = 0
and tw.status = 2
and tw.order_source = #{orderSource}
and tw.service_type = #{serviceType}
and tw.partner_order_no = #{partnerOrderNo}
and twv.vin = #{vin}
order by tw.id desc limit 1
</select>
</mapper>