2025-01-19 11:30:15 +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.TicketMapper" >
<sql id= "searchWhereCondition" >
2025-02-13 14:11:41 +08:00
<if test= "request.areaIds!=null" >
AND u.area_id IN
<foreach collection= "request.areaIds" item= "areaId" open= "(" separator= "," close= ")" >
#{areaId}
</foreach>
</if>
2025-01-27 16:08:17 +08:00
<if test= "request.title!=null and request.title!=''" >
2025-02-12 20:30:31 +08:00
AND (t.title LIKE CONCAT('%', #{request.title}, '%') OR t.no LIKE CONCAT('%', #{request.title}, '%'))
2025-01-19 11:30:15 +08:00
</if>
2025-01-27 16:08:17 +08:00
<if test= "request.deviceNo!=null and request.deviceNo!=''" >
2025-01-19 11:30:15 +08:00
AND t.device_no LIKE CONCAT('%', #{request.deviceNo}, '%')
</if>
2025-04-25 11:20:26 +08:00
<if test= "request.componentId!=null" >
AND t.component_id=#{request.componentId}
2025-01-19 11:30:15 +08:00
</if>
<if test= "request.state!=null" >
AND t.state=#{request.state}
</if>
<if test= "request.startTime!=null" >
AND t.create_time>=#{request.startTime}
</if>
<if test= "request.endTime!=null" >
AND t.create_time < #{request.endTime}
</if>
2025-04-28 15:08:44 +08:00
<if test= "request.pendingComments==true" >
AND te.id IS NULL
</if>
<if test= "request.pendingComments==false" >
2025-04-24 10:45:01 +08:00
AND te.id IS NOT NULL
</if>
2025-01-19 11:30:15 +08:00
</sql>
2025-01-25 23:11:05 +08:00
<sql id= "adminSearchWhereCondition" >
<where >
2025-02-14 17:00:34 +08:00
t.state!=4
2025-02-28 22:31:37 +08:00
<if test= "!request.ticketManager" >
2025-04-02 11:54:02 +08:00
AND (FIND_IN_SET(#{userId},t.handle)>0 OR fun_inAduit(t.id,#{userId})=1)
2025-02-28 22:31:37 +08:00
</if>
2025-01-25 23:11:05 +08:00
<if test= "request.state!=null" >
AND t.state=#{request.state}
</if>
<if test= "request.urgency!=null" >
AND t.urgency=#{request.urgency}
</if>
2025-04-25 11:20:26 +08:00
<if test= "request.componentId!=null" >
AND t.component_id=#{request.componentId}
2025-01-25 23:11:05 +08:00
</if>
<if test= "request.handleUserName!=null and request.handleUserName!=''" >
2025-02-19 15:37:49 +08:00
AND t.handle_name LIKE CONCAT('%', #{request.handleUserName}, '%')
2025-01-25 23:11:05 +08:00
</if>
2025-03-09 17:27:42 +08:00
<if test= "request.agentCode!=null and request.agentCode!=''" >
AND d.agent_code=#{request.agentCode}
2025-01-25 23:11:05 +08:00
</if>
2025-03-07 15:42:29 +08:00
<if test= "request.areaCode!=null and request.areaCode!=''" >
2025-03-13 17:24:07 +08:00
AND u.is_primary AND FIND_IN_SET(#{request.areaCode},fun_getPrimaryUserAreaCode(u.company_id))>0
2025-01-25 23:11:05 +08:00
</if>
<if test= "request.question!=null and request.question!=''" >
AND t.question=#{request.question}
</if>
2025-02-19 15:37:49 +08:00
<if test= "request.warrantyStatus!=null" >
AND d.warranty_state=#{request.warrantyStatus}
2025-01-25 23:11:05 +08:00
</if>
<if test= "request.startTime!=null" >
AND t.create_time>=#{request.startTime}
</if>
<if test= "request.endTime!=null" >
AND t.create_time < = #{request.endTime}
</if>
2025-02-19 15:37:49 +08:00
<if test= "request.title!=null and request.title!=''" >
AND (t.title LIKE CONCAT('%', #{request.title}, '%') OR t.no LIKE CONCAT('%', #{request.title}, '%'))
</if>
<if test= "request.deviceNo!=null and request.deviceNo!=''" >
AND t.device_no LIKE CONCAT('%', #{request.deviceNo}, '%')
</if>
<if test= "request.createUserName!=null and request.createUserName!=''" >
AND d.customer_name LIKE CONCAT('%', #{request.createUserName}, '%')
</if>
2025-01-25 23:11:05 +08:00
</where>
</sql>
2025-01-19 11:30:15 +08:00
<select id= "searchMy" resultType= "com.nflg.mobilebroken.common.pojo.vo.TicketVO" >
2025-05-05 13:17:52 +08:00
SELECT IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName',IF(tf.id IS NULL, false, true) AS 'followed'
2025-07-23 14:15:14 +08:00
,IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',IF(LENGTH(l.language_value)>0,l.language_value,p.part_name) AS 'component',t.*
2025-01-19 11:30:15 +08:00
FROM ticket t
2025-02-06 13:19:24 +08:00
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-06-26 17:52:43 +08:00
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=IF(#{from}='app',0,1)
2025-04-24 10:45:01 +08:00
LEFT JOIN ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-04-25 15:03:37 +08:00
LEFT JOIN t_base_language_data l ON p.id=l.source_id AND l.language_code=#{language}
2025-06-26 17:52:43 +08:00
WHERE t.user_id=#{userId} AND t.user_platform=#{from} AND t.state!=4
2025-01-19 11:30:15 +08:00
<include refid= "searchWhereCondition" />
2025-02-19 15:37:49 +08:00
ORDER BY t.id DESC
2025-01-19 11:30:15 +08:00
</select>
2025-01-25 23:11:05 +08:00
2025-01-19 11:30:15 +08:00
<select id= "searchFollow" resultType= "com.nflg.mobilebroken.common.pojo.vo.TicketVO" >
2025-05-05 13:17:52 +08:00
SELECT IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName',true AS 'followed'
2025-07-23 14:15:14 +08:00
,IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',true AS 'followed',t.handle,IF(LENGTH(l.language_value)>0
2025-05-05 13:17:52 +08:00
,l.language_value,p.part_name) AS 'component',t.*
2025-01-19 11:30:15 +08:00
FROM ticket t
2025-02-06 13:19:24 +08:00
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-06-26 17:52:43 +08:00
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.from=IF(#{from}='app',0,1)
2025-04-27 14:23:16 +08:00
LEFT JOIN ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-04-25 15:03:37 +08:00
LEFT JOIN t_base_language_data l ON p.id=l.source_id AND l.language_code=#{language}
2025-06-26 17:52:43 +08:00
WHERE tf.user_id=#{userId} AND t.user_platform=#{from} AND t.state!=4
2025-01-19 11:30:15 +08:00
<include refid= "searchWhereCondition" />
2025-02-19 15:37:49 +08:00
ORDER BY t.id DESC
2025-01-19 11:30:15 +08:00
</select>
2025-01-25 23:11:05 +08:00
2025-01-19 11:30:15 +08:00
<select id= "searchArea" resultType= "com.nflg.mobilebroken.common.pojo.vo.TicketVO" >
2025-05-05 13:17:52 +08:00
SELECT IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName'
2025-07-23 14:15:14 +08:00
,IF(tf.id IS NULL, false, true) AS 'followed',IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',IF(LENGTH(l.language_value)>0
2025-05-05 13:17:52 +08:00
,l.language_value,p.part_name) AS 'component',t.*
2025-01-19 11:30:15 +08:00
FROM ticket t
2025-02-17 20:51:37 +08:00
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-07-23 13:47:07 +08:00
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=IF(#{from}='app',0,1)
2025-04-27 14:23:16 +08:00
LEFT JOIN ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-04-25 15:03:37 +08:00
LEFT JOIN t_base_language_data l ON p.id=l.source_id AND l.language_code=#{language}
2025-04-30 17:08:22 +08:00
LEFT JOIN v_device vd ON t.device_no=vd.device_no
WHERE t.state!=4
2025-05-05 13:17:52 +08:00
<if test= "isPrimary==false" >
2025-04-30 17:08:22 +08:00
AND FIND_IN_SET(#{companyId},u.company_id) AND vd.agent_code=#{companyCode}
</if>
2025-05-05 13:17:52 +08:00
<if test= "isPrimary==true" >
2025-04-30 17:08:22 +08:00
AND (u.id=#{userId} OR FIND_IN_SET(u.company_id,#{companyId}))
</if>
2025-07-23 14:15:14 +08:00
<if test= "isPrimary==null" >
AND t.user_platform='admin'
</if>
2025-01-19 11:30:15 +08:00
<include refid= "searchWhereCondition" />
2025-02-19 15:37:49 +08:00
ORDER BY t.id DESC
2025-01-19 11:30:15 +08:00
</select>
2025-01-25 23:11:05 +08:00
2025-02-05 13:14:52 +08:00
<select id= "searchFromAdmin" resultType= "com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO" >
2025-04-25 11:20:26 +08:00
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
2025-03-07 15:42:29 +08:00
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
2025-07-23 14:15:14 +08:00
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
2025-02-19 15:37:49 +08:00
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',IF(tf.id IS NULL, false, true) AS 'followed',auc.user_name AS 'cqm'
2025-03-09 17:27:42 +08:00
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
2025-07-30 14:10:02 +08:00
,t.handle_name AS 'handle',t.description
2025-01-25 23:11:05 +08:00
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-07-23 16:37:54 +08:00
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
2025-02-19 15:37:49 +08:00
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
2025-02-05 13:14:52 +08:00
LEFT JOIN dictionary_item di ON d.warranty_state=di.id
2025-02-11 22:42:46 +08:00
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
2025-02-19 15:37:49 +08:00
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-01-25 23:11:05 +08:00
<include refid= "adminSearchWhereCondition" />
2025-03-10 20:03:46 +08:00
ORDER BY t.state,t.id DESC
2025-01-25 23:11:05 +08:00
</select>
<select id= "searchAllFromAdmin" resultType= "com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO" >
2025-04-25 11:20:26 +08:00
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
2025-03-07 15:42:29 +08:00
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
2025-07-23 14:15:14 +08:00
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
2025-02-19 15:37:49 +08:00
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',IF(tf.id IS NULL, false, true) AS 'followed',auc.user_name AS 'cqm'
2025-03-09 17:27:42 +08:00
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
2025-07-30 14:10:02 +08:00
,t.handle_name AS 'handle',t.description
2025-01-25 23:11:05 +08:00
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-07-23 16:37:54 +08:00
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
2025-02-19 15:37:49 +08:00
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
2025-02-05 13:14:52 +08:00
LEFT JOIN dictionary_item di ON d.warranty_state=di.id
2025-02-19 15:37:49 +08:00
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-01-25 23:11:05 +08:00
<include refid= "adminSearchWhereCondition" />
2025-03-10 20:03:46 +08:00
ORDER BY t.state,t.id DESC
2025-01-25 23:11:05 +08:00
</select>
2025-02-05 13:14:52 +08:00
<select id= "searchFromAdminAndFollow" resultType= "com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO" >
2025-04-25 11:20:26 +08:00
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
2025-03-07 15:42:29 +08:00
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
2025-07-23 14:15:14 +08:00
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
2025-02-19 15:37:49 +08:00
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
2025-03-03 21:13:01 +08:00
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',true AS 'followed',auc.user_name AS 'cqm'
2025-03-09 17:27:42 +08:00
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
2025-07-30 14:10:02 +08:00
,t.handle_name AS 'handle',t.description
2025-01-25 23:11:05 +08:00
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-02-09 23:49:05 +08:00
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
2025-07-23 16:37:54 +08:00
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
2025-02-19 15:37:49 +08:00
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
2025-02-05 13:14:52 +08:00
LEFT JOIN dictionary_item di ON d.warranty_state=di.id
2025-02-19 15:37:49 +08:00
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-01-25 23:11:05 +08:00
<include refid= "adminSearchWhereCondition" />
2025-03-10 20:03:46 +08:00
ORDER BY t.state,t.id DESC
2025-01-25 23:11:05 +08:00
</select>
<select id= "searchAllFromAdminAndFollow" resultType= "com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO" >
2025-04-25 11:20:26 +08:00
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
2025-03-07 15:42:29 +08:00
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
2025-07-23 14:15:14 +08:00
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
2025-03-03 21:13:01 +08:00
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',true AS 'followed'
2025-03-09 17:27:42 +08:00
,auc.user_name AS 'cqm',t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle'
2025-07-30 14:10:02 +08:00
,dt.cqm_person_name AS 'cqms',t.handle_name AS 'handle',t.description
2025-01-25 23:11:05 +08:00
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-02-17 20:51:37 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-02-09 23:49:05 +08:00
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
2025-07-23 16:37:54 +08:00
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
2025-02-19 15:37:49 +08:00
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
2025-02-05 13:14:52 +08:00
LEFT JOIN dictionary_item di ON d.warranty_state=di.id
2025-02-19 15:37:49 +08:00
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-01-25 23:11:05 +08:00
<include refid= "adminSearchWhereCondition" />
2025-03-10 20:03:46 +08:00
ORDER BY t.state,t.id DESC
2025-01-25 23:11:05 +08:00
</select>
2025-03-02 10:00:30 +08:00
<select id= "getAdminFavorites" resultType= "com.nflg.mobilebroken.common.pojo.vo.TicketVO" >
2025-03-06 11:31:58 +08:00
SELECT t.id, t.no, t.title
2025-03-02 10:00:30 +08:00
FROM ticket_follow tf
2025-03-06 11:31:58 +08:00
INNER JOIN ticket t ON tf.ticket_id = t.id
WHERE tf.`from` = 1
2025-06-26 17:52:43 +08:00
AND tf.user_id = #{userId} AND tf.from=IF(#{from}='app',0,1)
2025-03-06 11:31:58 +08:00
AND tf.favorites_id = #{favoritesId}
2025-03-10 20:03:46 +08:00
ORDER BY t.state,t.id DESC
2025-03-03 21:13:01 +08:00
</select>
<select id= "searchByFavouritesId" resultType= "com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO" >
2025-04-25 11:20:26 +08:00
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
2025-03-07 15:42:29 +08:00
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
2025-07-23 14:15:14 +08:00
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',IF(t.user_platform='admin',au.user_name,u.`name`) AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
2025-03-03 21:13:01 +08:00
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',true AS 'followed',auc.user_name AS 'cqm'
2025-03-09 17:27:42 +08:00
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
2025-07-30 14:10:02 +08:00
,t.handle_name AS 'handle',t.description
2025-03-03 21:13:01 +08:00
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
2025-07-23 14:15:14 +08:00
LEFT JOIN admin_user au ON t.user_id=au.id
2025-03-03 21:13:01 +08:00
LEFT JOIN app_area a2 ON u.area_id=a2.id
2025-03-13 17:24:07 +08:00
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
<if test= "favouritesId>0" >
AND tf.favorites_id=#{favouritesId}
</if>
2025-07-23 16:37:54 +08:00
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
2025-03-03 21:13:01 +08:00
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
LEFT JOIN dictionary_item di ON d.warranty_state=di.id
LEFT JOIN admin_user auc ON t.cqm=auc.id
LEFT JOIN admin_user auh ON t.current_handle=auh.id
2025-04-25 11:20:26 +08:00
LEFT JOIN t_base_part p ON t.component_id=p.id
2025-03-10 20:03:46 +08:00
ORDER BY t.state,t.id DESC
2025-03-02 10:00:30 +08:00
</select>
2025-01-19 11:30:15 +08:00
</mapper>