Commit 87665119 authored by zhuxiang's avatar zhuxiang
Browse files

增加用户名、绩效时间筛选

parent 2e5b6d80
...@@ -35,16 +35,15 @@ public class UserPerformanceController extends BaseController { ...@@ -35,16 +35,15 @@ public class UserPerformanceController extends BaseController {
private UserPerformanceService userPerformanceService; private UserPerformanceService userPerformanceService;
@PostMapping("page") @PostMapping("page")
public TableDataInfo page(@RequestBody UserPerformanceDTO userPerformanceDTO){ public TableDataInfo page(@RequestBody UserPerformanceDTO userPerformanceDTO) {
//查看当前登录用户信息 //查看当前登录用户信息
UserEntity user = userService.getById(userPerformanceDTO.getLoginUserId()); UserEntity user = userService.getById(userPerformanceDTO.getLoginUserId());
if(user.getUserRole().equals(Constant.ADMIN)){ if (user.getUserRole().equals(Constant.D_ADMIN)) {
return getDataTable(userPerformanceService.queryList(userPerformanceDTO));
}
if(user.getUserRole().equals(Constant.D_ADMIN)){
userPerformanceDTO.setDeptId(user.getDeptId()); userPerformanceDTO.setDeptId(user.getDeptId());
return getDataTable(userPerformanceService.queryList(userPerformanceDTO)); return getDataTable(userPerformanceService.queryList(userPerformanceDTO));
} else if (!user.getUserRole().equals(Constant.ADMIN)) {
userPerformanceDTO.setUserId(user.getId());
} }
return getDataTable(Lists.newArrayList()); return getDataTable(userPerformanceService.queryList(userPerformanceDTO));
} }
} }
...@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* @Author:zhuxiang * @Author:zhuxiang
* @Package:com.ruzhoukj.sms.model.dto * @Package:com.ruzhoukj.sms.model.dto
...@@ -23,4 +25,7 @@ public class UserPerformanceDTO extends UserPerformanceEntity { ...@@ -23,4 +25,7 @@ public class UserPerformanceDTO extends UserPerformanceEntity {
@ApiModelProperty(value = "当前登录用户Id") @ApiModelProperty(value = "当前登录用户Id")
private String loginUserId; private String loginUserId;
@ApiModelProperty(value = "用户名")
private String userName;
} }
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
and up.dept_id = #{deptId} and up.dept_id = #{deptId}
</if> </if>
<if test="userId != null and userId != ''">
and up.user_id = #{userId}
</if>
<if test="userName != null and userName != ''">
and u.name like concat('%',#{userName},'%')
</if>
<if test="performanceDate != null and performanceDate != ''"> <if test="performanceDate != null and performanceDate != ''">
and up.performance_date = #{performanceDate} and up.performance_date = #{performanceDate}
</if> </if>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment