维修员列表查询

This commit is contained in:
liang.chao 2024-06-26 09:35:50 +08:00
parent 36e9f75af2
commit c04a3b4738
2 changed files with 24 additions and 16 deletions

View File

@ -45,10 +45,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.MaintenanceGang"> <select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.MaintenanceGang">
SELECT su.user_id as userId, su.nick_name as userName FROM `sys_user` su SELECT DISTINCT
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id su.user_id AS userId,
su.nick_name AS userName
FROM
`sys_user` su
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
LEFT JOIN sys_role sr ON sr.role_id = sur.role_id LEFT JOIN sys_role sr ON sr.role_id = sur.role_id
WHERE sr.role_id = '102' AND su.del_flag = '0' WHERE
sr.role_id in (133,134)
AND su.del_flag = '0'
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND su.nick_name like concat('%', #{userName}, '%') AND su.nick_name like concat('%', #{userName}, '%')
</if> </if>

View File

@ -148,24 +148,26 @@ public class MaWholeSetServiceImpl implements MaWholeSetService {
maWhole.setWholeTypeName(dto.getWholeTypeName()); maWhole.setWholeTypeName(dto.getWholeTypeName());
maWhole.setParentId(dto.getParentId()); maWhole.setParentId(dto.getParentId());
} }
} int res = 0;
int res = 0; try {
try { deleteMaWhole(dto);
deleteMaWhole(dto); res = insertMaWholeSet(dto.getDeviceInfo());
res = insertMaWholeSet(dto.getDeviceInfo()); if (res == 0) {
if (res == 0) { log.error("insertMaWholeSet方法插入异常");
log.error("insertMaWholeSet方法插入异常"); throw new RuntimeException("insertMaWholeSet方法插入异常");
throw new RuntimeException("insertMaWholeSet方法插入异常"); }
}
/* int count = selectByParentId(dto.getWholeTypeName()); /* int count = selectByParentId(dto.getWholeTypeName());
if (count > 1) { if (count > 1) {
throw new RuntimeException("配套名称已重复,请重新输入"); throw new RuntimeException("配套名称已重复,请重新输入");
}*/ }*/
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return AjaxResult.error(ExceptionEnum.UPDATE_TO_DATABASE.getCode(), ExceptionEnum.UPDATE_TO_DATABASE.getMsg()); return AjaxResult.error(ExceptionEnum.UPDATE_TO_DATABASE.getCode(), ExceptionEnum.UPDATE_TO_DATABASE.getMsg());
}
return AjaxResult.success("修改成功", res);
} else {
return AjaxResult.error("请选择主/配套设备");
} }
return AjaxResult.success("修改成功", res);
} }
/** /**