2024-08-26 23:58:16 +08:00
|
|
|
<?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.hcy.common.mapper.order.RepairOrderMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
2024-08-28 01:23:17 +08:00
|
|
|
<select id="list" resultType="com.hcy.common.dto.order.RepairOrderDto">
|
|
|
|
select
|
|
|
|
ro.*,
|
|
|
|
u1.username as creatorName,
|
|
|
|
u2.username as receiverName,
|
|
|
|
c.client_name as clientName,
|
|
|
|
e.province_id as equipmentProvinceId,
|
|
|
|
e.district_id as equipmentDistrictId,
|
|
|
|
e.city_id as equipmentCityId,
|
|
|
|
e.longitude,
|
|
|
|
e.latitude
|
|
|
|
from la_repair_order as ro
|
|
|
|
LEFT JOIN la_client as c on ro.client_id = c.id
|
|
|
|
LEFT JOIN la_equipment as e ON e.id = ro.equipment_id
|
|
|
|
LEFT JOIN la_user as u1 on ro.creator_id = u1.id
|
|
|
|
LEFT JOIN la_user as u2 on ro.receiver_id = u2.id
|
|
|
|
where
|
|
|
|
ro.is_delete = 0
|
2024-08-31 02:11:22 +08:00
|
|
|
and ro.repair_work_order_flow = 0
|
2024-08-28 01:23:17 +08:00
|
|
|
<if test="form.id != null">
|
|
|
|
and ro.id = #{form.id}
|
|
|
|
</if>
|
|
|
|
<if test="form.orderNo != null and form.orderNo != ''">
|
|
|
|
and ro.order_no like concat('%', #{form.orderNo}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="form.orderSource != null">
|
|
|
|
and ro.order_source = #{form.orderSource}
|
|
|
|
</if>
|
|
|
|
<if test="form.orderStatus != null">
|
|
|
|
and find_in_set(ro.order_status,#{form.orderStatus})
|
|
|
|
</if>
|
|
|
|
order by ro.create_time desc
|
|
|
|
</select>
|
|
|
|
|
2024-08-26 23:58:16 +08:00
|
|
|
|
|
|
|
<select id="pageList" resultType="com.hcy.common.dto.order.RepairOrderDto">
|
2024-08-29 00:46:36 +08:00
|
|
|
select ro.*,
|
|
|
|
u1.username as creatorName,
|
|
|
|
u2.username as receiverName,
|
|
|
|
c.client_name as clientName,
|
|
|
|
c.short_name
|
2024-08-26 23:58:16 +08:00
|
|
|
from la_repair_order as ro
|
|
|
|
LEFT JOIN la_client as c on ro.client_id = c.id
|
|
|
|
LEFT JOIN la_user as u1 on ro.creator_id = u1.id
|
|
|
|
LEFT JOIN la_user as u2 on ro.receiver_id = u2.id
|
|
|
|
where
|
|
|
|
ro.is_delete = 0
|
|
|
|
<if test="form.id != null">
|
|
|
|
and ro.id = #{form.id}
|
|
|
|
</if>
|
|
|
|
<if test="form.orderNo != null and form.orderNo != ''">
|
|
|
|
and ro.order_no like concat('%', #{form.orderNo}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="form.orderSource != null">
|
|
|
|
and ro.order_source = #{form.orderSource}
|
|
|
|
</if>
|
|
|
|
<if test="form.clientName != null and form.clientName != ''">
|
|
|
|
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
|
|
|
</if>
|
2024-08-29 00:46:36 +08:00
|
|
|
<if test="form.receiverId != null">
|
|
|
|
and ro.receiver_id = #{form.receiverId}
|
|
|
|
</if>
|
|
|
|
<if test="form.clientId != null">
|
|
|
|
and ro.client_id = #{form.clientId}
|
|
|
|
</if>
|
2024-08-26 23:58:16 +08:00
|
|
|
<if test="form.creatorName != null and form.creatorName != ''">
|
|
|
|
and u1.username LIKE concat('%', #{form.creatorName}, '%')
|
|
|
|
</if>
|
|
|
|
<if test="form.receiverName != null and form.receiverName != ''">
|
|
|
|
and u2.username LIKE concat('%', #{form.receiverName}, '%')
|
|
|
|
</if>
|
2024-08-28 01:23:17 +08:00
|
|
|
<if test="form.likeWork != null and form.likeWork != ''">
|
|
|
|
and (ro.order_no like concat('%',#{form.likeWork},'%')
|
|
|
|
or u1.username LIKE concat('%', #{form.likeWork}, '%'))
|
|
|
|
</if>
|
|
|
|
<if test="form.orderStatus != null">
|
|
|
|
and find_in_set(ro.order_status,#{form.orderStatus})
|
|
|
|
</if>
|
|
|
|
<if test="form.orderStatusIds != null and form.orderStatusIds != ''">
|
|
|
|
and find_in_set(ro.order_status,#{form.orderStatusIds})
|
|
|
|
</if>
|
|
|
|
order by ro.create_time desc
|
2024-08-26 23:58:16 +08:00
|
|
|
</select>
|
|
|
|
|
2024-08-29 00:46:36 +08:00
|
|
|
<select id="selectPendingOrderCount" resultType="Integer">
|
|
|
|
SELECT
|
|
|
|
COUNT( order_status )
|
|
|
|
FROM
|
|
|
|
la_repair_order as lro
|
|
|
|
WHERE
|
|
|
|
is_delete = 0
|
|
|
|
<if test="param.receiverId != null">
|
|
|
|
and lro.receiver_id = #{param.receiverId}
|
|
|
|
</if>
|
|
|
|
<if test="param.clientId != null">
|
|
|
|
and lro.client_id = #{param.clientId}
|
|
|
|
</if>
|
|
|
|
<if test="param.orderStatusIds != null and param.orderStatusIds != ''">
|
|
|
|
and find_in_set(lro.order_status,#{param.orderStatusIds})
|
|
|
|
</if>
|
|
|
|
</select>
|
2024-08-26 23:58:16 +08:00
|
|
|
|
|
|
|
</mapper>
|