材料员优化
This commit is contained in:
parent
44fc28a2e3
commit
b7179fae41
|
|
@ -50,6 +50,7 @@ public class SelectServiceImpl implements SelectService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult getUnitList(BmUnit bmUnit) {
|
||||
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
|
||||
// 性能监控开始
|
||||
long startTime = System.currentTimeMillis();
|
||||
Map<String, Long> stepTimes = new LinkedHashMap<>();
|
||||
|
|
@ -72,6 +73,12 @@ public class SelectServiceImpl implements SelectService {
|
|||
if (Objects.nonNull(bmUnit) && Objects.nonNull(bmUnit.getEnableFilter()) && bmUnit.getEnableFilter()) {
|
||||
bmUnit.setDeptId(thisLoginUserDeptId);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(userRoles)) {
|
||||
// 技术员只查询项目部类型的单位,固定传值36(项目部类型)
|
||||
if (userRoles.contains("jsy")) {
|
||||
bmUnit.setTypeId(36L);
|
||||
}
|
||||
}
|
||||
stepTimes.put("过滤判断", System.currentTimeMillis() - step2Start);
|
||||
|
||||
// 步骤3: 判断是否是app模式
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="unitId != null">
|
||||
AND bu.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != 0">
|
||||
AND bu.type_id = #{typeId}
|
||||
</if>
|
||||
|
||||
UNION
|
||||
|
||||
|
|
@ -65,6 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="unitId != null">
|
||||
AND bu.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != 0">
|
||||
AND bu.type_id = #{typeId}
|
||||
</if>
|
||||
|
||||
UNION
|
||||
SELECT
|
||||
|
|
@ -93,6 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="unitId != null">
|
||||
AND bu.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != 0">
|
||||
AND bu.type_id = #{typeId}
|
||||
</if>
|
||||
) ff
|
||||
ORDER BY
|
||||
LEVEL
|
||||
|
|
@ -382,6 +391,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deptId != null and deptId != 0">
|
||||
AND bpl.imp_unit = #{deptId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != 0">
|
||||
AND bu.type_id = #{typeId}
|
||||
</if>
|
||||
</if>
|
||||
<if test="projectId == null">
|
||||
SELECT unit_id AS unitId,
|
||||
|
|
@ -391,6 +403,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="typeId != null and typeId != 0">
|
||||
AND bu.type_id = #{typeId}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue