2025-11-19 17:50:18 +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.nflg.mobilebroken.repository.mapper.GongfuDispatchMapper">
|
|
|
|
|
|
|
|
|
|
<select id="search" resultType="com.nflg.mobilebroken.common.pojo.vo.DispatchVO">
|
2026-01-08 13:44:48 +08:00
|
|
|
SELECT da.*,dv.customer_name,bc.agency_company_name as agent_name,af.reason as "delayReason",af2.id as
|
2026-01-09 14:39:15 +08:00
|
|
|
"applyforId",if(da.create_by_id =#{userId} or da.handler_user_id = #{userId},1,0) AS usort,di.name as "typeDesc"
|
2025-11-19 17:50:18 +08:00
|
|
|
FROM gongfu_dispatch da
|
|
|
|
|
LEFT JOIN v_gongfu_device dv ON da.device_no=dv.device_no
|
2026-02-06 16:49:45 +08:00
|
|
|
LEFT JOIN t_base_customer bc ON dv.service_agent_code=bc.agency_company_code
|
2025-11-24 17:53:06 +08:00
|
|
|
left join v_dispatch_applyfor af on da.id=af.ticket_id
|
2025-12-12 17:57:13 +08:00
|
|
|
left join gongfu_dispatch_applyfor af2 on da.id=af2.ticket_id and af2.audit_state=0
|
2026-01-09 14:39:15 +08:00
|
|
|
left join dictionary_item di on da.type=di.id
|
2025-11-19 17:50:18 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="request.deviceNo!=null and request.deviceNo!=''">
|
|
|
|
|
AND da.device_no=#{request.deviceNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.handlerUserName!=null and request.handlerUserName!=''">
|
|
|
|
|
AND da.handler_user_name LIKE CONCAT('%',#{request.handlerUserName},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.customerName!=null and request.customerName!=''">
|
|
|
|
|
AND dv.customer_name LIKE CONCAT('%',#{request.customerName},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.state!=null">
|
|
|
|
|
AND da.state=#{request.state}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.category!=null">
|
|
|
|
|
AND da.category= #{request.category}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.createUserName!=null and request.createUserName!=''">
|
|
|
|
|
AND da.create_by LIKE CONCAT('%',#{request.createUserName},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.startDate!=null">
|
|
|
|
|
AND da.plan_start_date >= #{request.startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.endDate!=null">
|
|
|
|
|
AND da.plan_end_date >= #{request.endDate}
|
|
|
|
|
</if>
|
2025-11-24 17:53:06 +08:00
|
|
|
<if test="request.key!=null and request.key!=''">
|
|
|
|
|
AND (da.device_no like concat('%',#{request.key},'%')
|
2026-01-08 13:44:48 +08:00
|
|
|
or da.handler_user_name like concat('%',#{request.key},'%')
|
|
|
|
|
or da.title like concat('%',#{request.key},'%')
|
|
|
|
|
or dv.customer_name like concat('%',#{request.key},'%')
|
2025-11-24 17:53:06 +08:00
|
|
|
)
|
|
|
|
|
</if>
|
2026-03-12 08:57:08 +08:00
|
|
|
<if test="request.ids!=null">
|
|
|
|
|
AND da.id in
|
|
|
|
|
<foreach collection="request.ids" item="item" open="(" close=")" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
2025-11-19 17:50:18 +08:00
|
|
|
</where>
|
2026-01-08 13:44:48 +08:00
|
|
|
ORDER BY usort DESC,da.state,da.plan_start_date DESC,da.id DESC
|
2025-11-19 17:50:18 +08:00
|
|
|
</select>
|
2025-11-24 17:53:06 +08:00
|
|
|
|
|
|
|
|
<select id="getInfo" resultType="com.nflg.mobilebroken.common.pojo.vo.DispatchVO">
|
2025-11-26 18:03:19 +08:00
|
|
|
SELECT da.*,dv.customer_name,bc.agency_company_name as agent_name,af.reason as "delayReason"
|
2026-01-09 14:39:15 +08:00
|
|
|
, di1.name as "typeDesc"
|
|
|
|
|
, di2.name as "categoryDesc"
|
2025-11-24 17:53:06 +08:00
|
|
|
FROM gongfu_dispatch da
|
|
|
|
|
LEFT JOIN v_gongfu_device dv ON da.device_no=dv.device_no
|
2026-02-06 16:49:45 +08:00
|
|
|
LEFT JOIN t_base_customer bc ON dv.service_agent_code=bc.agency_company_code
|
2025-11-26 18:03:19 +08:00
|
|
|
left join v_dispatch_applyfor af on da.id=af.ticket_id
|
2026-01-09 14:39:15 +08:00
|
|
|
left join dictionary_item di1 on da.type = di1.id
|
|
|
|
|
left join dictionary_item di2 on da.category = di2.id
|
2025-11-24 17:53:06 +08:00
|
|
|
where da.id = #{id}
|
|
|
|
|
</select>
|
2025-12-17 18:01:15 +08:00
|
|
|
|
|
|
|
|
<select id="getForBI" resultType="com.nflg.mobilebroken.repository.entity.GongfuDispatch">
|
|
|
|
|
SELECT gd.*
|
|
|
|
|
FROM gongfu_dispatch gd
|
|
|
|
|
LEFT JOIN admin_user au ON gd.handler_user_id = au.id
|
|
|
|
|
WHERE gd.handler_user_type=1 and gd.state in
|
|
|
|
|
<foreach collection="states" close=")" open="(" item="state" separator=",">
|
|
|
|
|
#{state}
|
|
|
|
|
</foreach>
|
|
|
|
|
<if test="deptId!=null">
|
|
|
|
|
and au.department_id=#{deptId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startDate!=null">
|
|
|
|
|
and gd.plan_start_date >= #{startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDate!=null">
|
|
|
|
|
and gd.plan_end_date <= #{endDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userName!=null and userName!=''">
|
|
|
|
|
and au.user_name LIKE CONCAT('%',#{userName},'%')
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
2025-11-19 17:50:18 +08:00
|
|
|
</mapper>
|