refactor(repository): 优化消息服务接口及工单查询逻辑
- 将 AdminMessageServiceImpl.remove 方法中的 sourceId 类型由 Integer 改为 Long,统一接口参数类型 - 修改 IAdminMessageService 接口的 remove 方法签名,确保一致性 - 优化 GongFuTicketCreateEvent 中获取处理人 IDs 的方式,避免转换错误 - GongfuTicketServiceImpl 新增设置 cqm 字段,完善工单创建信息 - 调整 TicketCompleteEvent 中消息子类型为 TicketSolutionAudit,修正业务流程 - 修改 TicketMapper.xml 中多处 SQL 联表查询,新增 t_base_area 表连接 - 新增 TableInfoService 和 TableMetaMapper,提供表结构元数据查询功能 - 修复 TicketSolutionAuditServiceImpl 中调用 adminMessageService.remove 的参数类型不匹配问题
This commit is contained in:
parent
6ea9da90a4
commit
d7162092ff
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.nflg.mobilebroken.admin.service;
|
||||||
|
|
||||||
|
import com.nflg.mobilebroken.repository.mapper.TableMetaMapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class TableInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TableMetaMapper tableMetaMapper;
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getTableColumnInfos(String tableName) {
|
||||||
|
return tableMetaMapper.getTableColumnMeta(tableName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ public class GongFuTicketCreateEvent extends ApplicationEvent implements Applica
|
||||||
|
|
||||||
private void sendUserMessage1() {
|
private void sendUserMessage1() {
|
||||||
//我的待办
|
//我的待办
|
||||||
List<AdminUser> handlers = adminUserService.listByIds(Collections.singleton(StrUtil.splitToLong(ticket.getHandle(), ",")));
|
List<AdminUser> handlers = adminUserService.listByIds(Arrays.stream(StrUtil.splitToLong(ticket.getHandle(), ",")).boxed().collect(Collectors.toList()));
|
||||||
if (CollectionUtil.isNotEmpty(handlers)) {
|
if (CollectionUtil.isNotEmpty(handlers)) {
|
||||||
handlers.forEach(c -> adminMessageService.add(
|
handlers.forEach(c -> adminMessageService.add(
|
||||||
new AdminMessage()
|
new AdminMessage()
|
||||||
|
|
@ -157,7 +157,7 @@ public class GongFuTicketCreateEvent extends ApplicationEvent implements Applica
|
||||||
.replace("${handleUser}", "")
|
.replace("${handleUser}", "")
|
||||||
.replace("${createTime}", toTimeString(ticket.getCreateTime()))
|
.replace("${createTime}", toTimeString(ticket.getCreateTime()))
|
||||||
.replace("${msg}", subject);
|
.replace("${msg}", subject);
|
||||||
List<AdminUser> handlers = adminUserService.listByIds(Collections.singleton(StrUtil.splitToLong(ticket.getHandle(), ",")));
|
List<AdminUser> handlers = adminUserService.listByIds(Arrays.stream(StrUtil.splitToLong(ticket.getHandle(), ",")).boxed().collect(Collectors.toList()));
|
||||||
sendEmail(handlers.stream().map(AdminUser::getEmail).collect(Collectors.toSet()), subject, content);
|
sendEmail(handlers.stream().map(AdminUser::getEmail).collect(Collectors.toSet()), subject, content);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error("邮件发送失败", ex);
|
log.error("邮件发送失败", ex);
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ public class TicketCompleteEvent extends ApplicationEvent implements Application
|
||||||
.setSourceId(ticket.getId())
|
.setSourceId(ticket.getId())
|
||||||
.setSource(3)
|
.setSource(3)
|
||||||
.setType(MessageType.WorkOrderAssignment.getState())
|
.setType(MessageType.WorkOrderAssignment.getState())
|
||||||
.setSubType(MessageSubType.TicketCompletion.getState())
|
.setSubType(MessageSubType.TicketSolutionAudit.getState())
|
||||||
.setIsRead(false)
|
.setIsRead(false)
|
||||||
.setCreateTime(LocalDateTime.now()))
|
.setCreateTime(LocalDateTime.now()))
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.nflg.mobilebroken.repository.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface TableMetaMapper {
|
||||||
|
|
||||||
|
@Select("SELECT COLUMN_NAME as name, COLUMN_COMMENT as comment " +
|
||||||
|
"FROM information_schema.COLUMNS " +
|
||||||
|
"WHERE TABLE_NAME = #{tableName}")
|
||||||
|
List<Map<String, Object>> getTableColumnMeta(@Param("tableName") String tableName);
|
||||||
|
}
|
||||||
|
|
@ -31,7 +31,7 @@ public interface IAdminMessageService extends IService<AdminMessage> {
|
||||||
|
|
||||||
Integer getNotReadMessageCount(Integer userId);
|
Integer getNotReadMessageCount(Integer userId);
|
||||||
|
|
||||||
void remove(Integer source, Integer sourceId, Integer userId, Integer subType);
|
void remove(Integer source, Long sourceId, Integer userId, Integer subType);
|
||||||
|
|
||||||
AdminNotReadMessageCountVO getNotReadMessageCount1(Integer userId);
|
AdminNotReadMessageCountVO getNotReadMessageCount1(Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ public class AdminMessageServiceImpl extends ServiceImpl<AdminMessageMapper, Adm
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(Integer source, Integer sourceId, Integer userId, Integer subType) {
|
public void remove(Integer source, Long sourceId, Integer userId, Integer subType) {
|
||||||
remove(new LambdaQueryWrapper<AdminMessage>()
|
remove(new LambdaQueryWrapper<AdminMessage>()
|
||||||
.eq(AdminMessage::getSource, source)
|
.eq(AdminMessage::getSource, source)
|
||||||
.eq(AdminMessage::getSourceId, sourceId)
|
.eq(AdminMessage::getSourceId, sourceId)
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
|
||||||
.last("LIMIT 1")
|
.last("LIMIT 1")
|
||||||
.one();
|
.one();
|
||||||
String no = lastTicket == null ? TicketUtil.getNextNo("GFGD", null) : TicketUtil.getNextNo("GFGD", lastTicket.getNo());
|
String no = lastTicket == null ? TicketUtil.getNextNo("GFGD", null) : TicketUtil.getNextNo("GFGD", lastTicket.getNo());
|
||||||
|
List<Integer> cqms = deviceTypeService.getCqms(request.getDeviceNo());
|
||||||
GongfuTicket ticket = new GongfuTicket()
|
GongfuTicket ticket = new GongfuTicket()
|
||||||
.setNo(no)
|
.setNo(no)
|
||||||
.setDeviceNo(request.getDeviceNo())
|
.setDeviceNo(request.getDeviceNo())
|
||||||
|
|
@ -86,6 +87,7 @@ public class GongfuTicketServiceImpl extends ServiceImpl<GongfuTicketMapper, Gon
|
||||||
.setSource(request.getSource())
|
.setSource(request.getSource())
|
||||||
.setAreaId(request.getAreaId())
|
.setAreaId(request.getAreaId())
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
|
.setCqm(CollectionUtil.get(cqms, 0))
|
||||||
.setThroughput(request.getThroughput())
|
.setThroughput(request.getThroughput())
|
||||||
.setUserPlatform(AppUserUtil.getFrom())
|
.setUserPlatform(AppUserUtil.getFrom())
|
||||||
.setCreateTime(LocalDateTime.now());
|
.setCreateTime(LocalDateTime.now());
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
|
||||||
audit.setId(detp.getId());
|
audit.setId(detp.getId());
|
||||||
TicketSolutionAudit entity = getById(detp.getId());
|
TicketSolutionAudit entity = getById(detp.getId());
|
||||||
if (!Objects.equals(entity.getUserId(), detp.getUserId()) || Objects.equals(entity.getState(), 0)) {
|
if (!Objects.equals(entity.getUserId(), detp.getUserId()) || Objects.equals(entity.getState(), 0)) {
|
||||||
adminMessageService.remove(0, ticket.getId(), entity.getUserId(), MessageSubType.TicketSolutionAudit.getState());
|
adminMessageService.remove(0, Long.valueOf(ticket.getId()), entity.getUserId(), MessageSubType.TicketSolutionAudit.getState());
|
||||||
adminMessageService.add(
|
adminMessageService.add(
|
||||||
new AdminMessage()
|
new AdminMessage()
|
||||||
.setNo(ticket.getNo())
|
.setNo(ticket.getNo())
|
||||||
|
|
|
||||||
|
|
@ -128,13 +128,14 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="searchArea" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketVO">
|
<select id="searchArea" resultType="com.nflg.mobilebroken.common.pojo.vo.TicketVO">
|
||||||
SELECT IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),a2.`name`) AS 'areaName'
|
SELECT IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),IF(u.type=1,a3.area_name,a2.`name`)) AS 'areaName'
|
||||||
,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
|
,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
|
||||||
,l.language_value,p.part_name) AS 'component',t.*
|
,l.language_value,p.part_name) AS 'component',t.*
|
||||||
FROM v_all_ticket t
|
FROM v_all_ticket t
|
||||||
LEFT JOIN app_user u ON t.user_id=u.id
|
LEFT JOIN app_user u ON t.user_id=u.id
|
||||||
LEFT JOIN admin_user au ON t.user_id=au.id
|
LEFT JOIN admin_user au ON t.user_id=au.id
|
||||||
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
||||||
|
LEFT JOIN t_base_area a3 ON u.area_id=a3.id
|
||||||
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=IF(#{from}='app',0,1)
|
LEFT JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=IF(#{from}='app',0,1)
|
||||||
LEFT JOIN ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
|
LEFT JOIN ticket_evaluate te ON t.id=te.ticket_id AND t.state=2
|
||||||
LEFT JOIN v_device_part p ON t.component_id=p.id
|
LEFT JOIN v_device_part p ON t.component_id=p.id
|
||||||
|
|
@ -142,7 +143,7 @@
|
||||||
LEFT JOIN v_all_device vd ON t.device_no=vd.device_no
|
LEFT JOIN v_all_device vd ON t.device_no=vd.device_no
|
||||||
WHERE t.state!=4
|
WHERE t.state!=4
|
||||||
<if test="isPrimary!=null">
|
<if test="isPrimary!=null">
|
||||||
and vd.agent_code in
|
AND t.user_platform='app' and vd.agent_code in
|
||||||
<foreach collection="companyCodes" item="item" open="(" close=")" separator=",">
|
<foreach collection="companyCodes" item="item" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
@ -156,7 +157,7 @@
|
||||||
|
|
||||||
<select id="searchFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
<select id="searchFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
||||||
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS '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'
|
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),IF(u.type=1,a3.area_name,'')) AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
|
||||||
,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'
|
,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'
|
||||||
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
|
,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'
|
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',IF(tf.id IS NULL, false, true) AS 'followed',auc.user_name AS 'cqm'
|
||||||
|
|
@ -166,6 +167,7 @@
|
||||||
LEFT JOIN app_user u ON t.user_id=u.id
|
LEFT JOIN app_user u ON t.user_id=u.id
|
||||||
LEFT JOIN admin_user au ON t.user_id=au.id
|
LEFT JOIN admin_user au ON t.user_id=au.id
|
||||||
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
||||||
|
LEFT JOIN t_base_area a3 ON u.area_id=a3.id
|
||||||
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
||||||
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
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 dictionary_item di ON d.warranty_state=di.id
|
||||||
|
|
@ -179,7 +181,7 @@
|
||||||
|
|
||||||
<select id="searchAllFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
<select id="searchAllFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
||||||
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS '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'
|
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),IF(u.type=1,a3.area_name,'')) AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
|
||||||
,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'
|
,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'
|
||||||
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
|
,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'
|
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',IF(tf.id IS NULL, false, true) AS 'followed',auc.user_name AS 'cqm'
|
||||||
|
|
@ -189,6 +191,7 @@
|
||||||
LEFT JOIN app_user u ON t.user_id=u.id
|
LEFT JOIN app_user u ON t.user_id=u.id
|
||||||
LEFT JOIN admin_user au ON t.user_id=au.id
|
LEFT JOIN admin_user au ON t.user_id=au.id
|
||||||
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
||||||
|
LEFT JOIN t_base_area a3 ON u.area_id=a3.id
|
||||||
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
||||||
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
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 dictionary_item di ON d.warranty_state=di.id
|
||||||
|
|
@ -202,7 +205,7 @@
|
||||||
|
|
||||||
<select id="searchFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
<select id="searchFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
||||||
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS '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'
|
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),IF(u.type=1,a3.area_name,'')) AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
|
||||||
,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'
|
,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'
|
||||||
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
|
,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'
|
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',true AS 'followed',auc.user_name AS 'cqm'
|
||||||
|
|
@ -212,6 +215,7 @@
|
||||||
LEFT JOIN app_user u ON t.user_id=u.id
|
LEFT JOIN app_user u ON t.user_id=u.id
|
||||||
LEFT JOIN admin_user au ON t.user_id=au.id
|
LEFT JOIN admin_user au ON t.user_id=au.id
|
||||||
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
||||||
|
LEFT JOIN t_base_area a3 ON u.area_id=a3.id
|
||||||
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
|
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
|
||||||
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
||||||
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
||||||
|
|
@ -225,7 +229,7 @@
|
||||||
|
|
||||||
<select id="searchAllFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
<select id="searchAllFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
||||||
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS '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'
|
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),IF(u.type=1,a3.area_name,'')) AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
|
||||||
,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'
|
,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'
|
||||||
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',true AS 'followed'
|
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',true AS 'followed'
|
||||||
,auc.user_name AS 'cqm',t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle'
|
,auc.user_name AS 'cqm',t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle'
|
||||||
|
|
@ -234,6 +238,7 @@
|
||||||
LEFT JOIN app_user u ON t.user_id=u.id
|
LEFT JOIN app_user u ON t.user_id=u.id
|
||||||
LEFT JOIN admin_user au ON t.user_id=au.id
|
LEFT JOIN admin_user au ON t.user_id=au.id
|
||||||
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
||||||
|
LEFT JOIN t_base_area a3 ON u.area_id=a3.id
|
||||||
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
|
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
|
||||||
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
LEFT JOIN device d ON t.device_no=d.device_no and d.data_valid_state=1
|
||||||
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
||||||
|
|
@ -258,7 +263,7 @@
|
||||||
|
|
||||||
<select id="searchByFavouritesId" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
<select id="searchByFavouritesId" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
|
||||||
SELECT t.id,t.`no`,t.title,t.state,t.urgency,p.part_name AS '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'
|
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),IF(u.type=1,a3.area_name,'')) AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
|
||||||
,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'
|
,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'
|
||||||
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
|
,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'
|
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',true AS 'followed',auc.user_name AS 'cqm'
|
||||||
|
|
@ -268,6 +273,7 @@
|
||||||
LEFT JOIN app_user u ON t.user_id=u.id
|
LEFT JOIN app_user u ON t.user_id=u.id
|
||||||
LEFT JOIN admin_user au ON t.user_id=au.id
|
LEFT JOIN admin_user au ON t.user_id=au.id
|
||||||
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
LEFT JOIN app_area a2 ON u.area_id=a2.id
|
||||||
|
LEFT JOIN t_base_area a3 ON u.area_id=a3.id
|
||||||
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
|
INNER JOIN ticket_follow tf ON t.id=tf.ticket_id AND tf.user_id=#{userId} AND tf.from=1
|
||||||
<if test="favouritesId>0">
|
<if test="favouritesId>0">
|
||||||
AND tf.favorites_id=#{favouritesId}
|
AND tf.favorites_id=#{favouritesId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue