src/main/java/org/springblade/modules/desk/controller/NoticeController.java
@@ -33,7 +33,9 @@ import org.springblade.modules.desk.vo.NoticeVO; import org.springblade.modules.desk.wrapper.NoticeWrapper; import org.springblade.modules.system.entity.Dept; import org.springblade.modules.system.entity.User; import org.springblade.modules.system.service.IDeptService; import org.springblade.modules.system.service.IUserService; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; @@ -54,7 +56,7 @@ private final INoticeService noticeService; private final IDeptService iDeptService; private final IUserService userService; /** * 详情 @@ -93,13 +95,6 @@ @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入notice") public R<IPage<NoticeVO>> page(@ApiIgnore NoticeVO notice, Query query) { //通过deptId获取组织机构信息 Dept dept = iDeptService.getById(notice.getDeptId()); // if (dept.getDeptCategory() == 1) { // notice.setCategory(1); // } else { // notice.setCategory(2); // } IPage<NoticeVO> pages = noticeService.selectNoticePage(Condition.getPage(query), notice); return R.data(pages); } src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
@@ -40,17 +40,33 @@ d.dict_value AS categoryName FROM blade_notice n LEFT JOIN ( SELECT * FROM blade_dict WHERE code = 'notice' ) d ON n.category = d.dict_key LEFT JOIN ( SELECT * FROM blade_dict WHERE code = 'notice' ) d ON n.category = d.dict_key <if test="notice.deptId!=null and notice.jurisdiction!=null"> left join blade_user bu on bu.dept_id = n.dept_id </if> WHERE n.is_deleted = 0 and n.tenant_id = #{notice.tenantId} n.is_deleted = 0 <if test="notice.title!=null"> and n.title like concat(concat('%', #{notice.title}), '%') </if> <if test="notice.category!=null"> and n.category = #{notice.category} </if> <if test="notice.deptId!=null"> and (n.dept_id = #{notice.deptId} or n.category = 2) <if test="notice.deptId!=null and notice.jurisdiction!=null"> and (n.dept_id = #{notice.deptId} or bu.jurisdiction = #{notice.jurisdiction} or n.dept_id = 1123598813738675201 ) </if> <if test="notice.deptId!=null and notice.jurisdiction==null"> and (n.dept_id = #{notice.deptId} and n.category=2 or n.dept_id = 1123598813738675201 ) </if> <if test="notice.startTime!=null and notice.startTime!=''"> and n.release_time >= #{notice.startTime} src/main/java/org/springblade/modules/desk/vo/NoticeVO.java
@@ -30,4 +30,14 @@ */ private String endTime; /** * 行政区(辖区)id */ private Long jurisdiction; /** * 用户id */ private Long userId; }