fix: 设备部件添加多语言支持

This commit is contained in:
曹鹏飞 2025-04-25 11:20:26 +08:00
parent c9ed712d29
commit a99b0c3ca1
2 changed files with 22 additions and 13 deletions

View File

@ -23,7 +23,7 @@ public class TicketSearchRequest extends PageRequest {
private String deviceNo;
//问题部位
private String component;
private Integer componentId;
//工单状态
private Integer state;

View File

@ -15,8 +15,8 @@
<if test="request.deviceNo!=null and request.deviceNo!=''">
AND t.device_no LIKE CONCAT('%', #{request.deviceNo}, '%')
</if>
<if test="request.component!=null and request.component!=''">
AND t.component=#{request.component}
<if test="request.componentId!=null">
AND t.component_id=#{request.componentId}
</if>
<if test="request.state!=null">
AND t.state=#{request.state}
@ -41,8 +41,8 @@
<if test="request.urgency!=null">
AND t.urgency=#{request.urgency}
</if>
<if test="request.component!=null and request.component!=''">
AND t.component=#{request.component}
<if test="request.componentId!=null">
AND t.component_id=#{request.componentId}
</if>
<if test="request.handleUserName!=null and request.handleUserName!=''">
AND t.handle_name LIKE CONCAT('%', #{request.handleUserName}, '%')
@ -79,22 +79,25 @@
<select id="searchMy" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketVO">
SELECT t.*,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName',IF(tf.id IS NULL, false, true) AS 'followed'
,u.`name` AS 'createBy',t.handle
,u.`name` AS 'createBy',t.handle,p.part_name AS 'component'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
LEFT JOIN app_area a2 ON u.area_id=a2.id
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=0
LEFT JOIN t_base_part p ON t.component_id=p.id
WHERE t.user_id=#{userId} AND t.state!=4
<include refid="searchWhereCondition"/>
ORDER BY t.id DESC
</select>
<select id="searchFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketVO">
SELECT t.*,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName',true AS 'followed',u.`name` AS 'createBy',true AS 'followed',t.handle
SELECT t.*,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName',true AS 'followed'
,u.`name` AS 'createBy',true AS 'followed',t.handle,p.part_name AS 'component'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
LEFT JOIN app_area a2 ON u.area_id=a2.id
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.from=0
LEFT JOIN t_base_part p ON t.component_id=p.id
WHERE tf.user_id=#{userId} AND t.state!=4
<include refid="searchWhereCondition"/>
ORDER BY t.id DESC
@ -102,11 +105,12 @@
<select id="searchArea" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketVO">
SELECT t.*,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName',IF(tf.id IS NULL, false, true) AS 'followed'
,u.`name` AS 'createBy',t.handle
,u.`name` AS 'createBy',t.handle,p.part_name AS 'component'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
LEFT JOIN app_area a2 ON u.area_id=a2.id
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=0
LEFT JOIN t_base_part p ON t.component_id=p.id
WHERE t.state!=4 AND u.company_id IN
<foreach collection="companyIds" item="companyId" open="(" separator="," close=")">
#{companyId}
@ -116,7 +120,7 @@
</select>
<select id="searchFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.reason
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
@ -132,12 +136,13 @@
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
LEFT JOIN t_base_part p ON t.component_id=p.id
<include refid="adminSearchWhereCondition"/>
ORDER BY t.state,t.id DESC
</select>
<select id="searchAllFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.reason
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
@ -153,12 +158,13 @@
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
LEFT JOIN t_base_part p ON t.component_id=p.id
<include refid="adminSearchWhereCondition"/>
ORDER BY t.state,t.id DESC
</select>
<select id="searchFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.reason
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
@ -174,12 +180,13 @@
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
LEFT JOIN t_base_part p ON t.component_id=p.id
<include refid="adminSearchWhereCondition"/>
ORDER BY t.state,t.id DESC
</select>
<select id="searchAllFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.reason
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',true AS 'followed'
@ -194,6 +201,7 @@
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
LEFT JOIN t_base_part p ON t.component_id=p.id
<include refid="adminSearchWhereCondition"/>
ORDER BY t.state,t.id DESC
</select>
@ -209,7 +217,7 @@
</select>
<select id="searchByFavouritesId" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.reason
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS 'component',t.question,t.reason
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
@ -228,6 +236,7 @@
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
LEFT JOIN t_base_part p ON t.component_id=p.id
ORDER BY t.state,t.id DESC
</select>
</mapper>