src/main/java/org/springblade/modules/desk/controller/NoticeController.java
@@ -32,6 +32,8 @@ import org.springblade.modules.desk.service.INoticeService; 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.service.IDeptService; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; @@ -51,6 +53,8 @@ public class NoticeController extends BladeController { private final INoticeService noticeService; private final IDeptService iDeptService; /** * 详情 @@ -89,6 +93,13 @@ @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/entity/Notice.java
@@ -16,6 +16,7 @@ */ package org.springblade.modules.desk.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -60,5 +61,10 @@ @ApiModelProperty(value = "内容") private String content; /** * 单位id */ @TableField("dept_id") private Long deptId; } src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
@@ -40,7 +40,7 @@ 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 WHERE n.is_deleted = 0 and n.tenant_id = #{notice.tenantId} <if test="notice.title!=null"> @@ -49,5 +49,14 @@ <if test="notice.category!=null"> and n.category = #{notice.category} </if> <if test="notice.startTime!=null and notice.startTime!=''"> and n.release_time >= #{notice.startTime} </if> <if test="notice.endTime!=null and notice.endTime!=''"> and n.release_time <= #{notice.endTime} </if> <if test="notice.category!=null"> and n.category = #{notice.category} </if> </select> </mapper> src/main/java/org/springblade/modules/desk/vo/NoticeVO.java
@@ -20,4 +20,14 @@ @ApiModelProperty(value = "租户编号") private String tenantId; /** * 通知开始时间 */ private String startTime; /** * 通知结束时间 */ private String endTime; } src/main/java/org/springblade/modules/training/entity/TrainingRegistration.java
@@ -91,4 +91,9 @@ @DateTimeFormat(pattern = "yyyy-MM-dd") private Date trainingTime; /** * 是否取消报名 1:否 2:是 */ private Integer cancel; } src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml
@@ -20,6 +20,9 @@ <if test="trainingRegistration.name!=null and trainingRegistration.name!=''"> and sr.name like concat('%', #{trainingRegistration.name},'%') </if> <if test="trainingRegistration.cancel!=null"> and sr.cancel = #{trainingRegistration.cancel} </if> </select> <!--报名培训详情信息-->