Browse Source

论坛指南管理-页面开发

feature/syp_points
zhangyongzhangyong 5 years ago
parent
commit
1a4a044824
  1. 1
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java
  2. 99
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideDTO.java
  3. 81
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideRelationDTO.java
  4. 77
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/enums/DayOfWeekEnum.java
  5. 92
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideController.java
  6. 94
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideRelationController.java
  7. 54
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideDao.java
  8. 64
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideRelationDao.java
  9. 51
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideEntity.java
  10. 51
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideRelationEntity.java
  11. 62
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideExcel.java
  12. 62
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideRelationExcel.java
  13. 47
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRedis.java
  14. 47
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRelationRedis.java
  15. 123
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideRelationService.java
  16. 96
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideService.java
  17. 119
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideRelationServiceImpl.java
  18. 181
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideServiceImpl.java
  19. 49
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideDao.xml
  20. 49
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml

1
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/NumConstant.java

@ -42,5 +42,6 @@ public interface NumConstant {
String FOUR_STR = "4"; String FOUR_STR = "4";
String FIVE_STR = "5"; String FIVE_STR = "5";
String SIX_STR = "6"; String SIX_STR = "6";
String SEVEN_STR = "7";
} }

99
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideDTO.java

@ -0,0 +1,99 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.Data;
/**
* 党群指南
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Data
public class PartyGroupGuideDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 内容
*/
private String content;
/**
* 显示时间1-周一2-周二3-周三4-周四5-周五6-周六7-周日
*/
private String dayOfWeek;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识0-1-
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
// 虚字段
/**
* 党群id
*/
private List<String> partyGroupIdList;
/**
* 党群名称
*/
private String partyGroupName;
/**
* 党群id
*/
private String partyGroupId;
}

81
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupGuideRelationDTO.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 党群指南关系表
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Data
public class PartyGroupGuideRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 党群ID
*/
private String partyGroupId;
/**
* 党群指南表ID
*/
private String partyGroupGuideId;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识0-1-
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

77
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/enums/DayOfWeekEnum.java

@ -0,0 +1,77 @@
package com.elink.esua.epdc.dto.enums;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
/**
* 一周七天 枚举
*
* @author zhangyong
* @date 2020-06-17
*/
public enum DayOfWeekEnum {
/**
* 1-周一
*/
ONE(NumConstant.ONE_STR, "周一"),
/**
* 2-周二
*/
TWO(NumConstant.TWO_STR, "周二"),
/**
* 3-周三
*/
THREE(NumConstant.THREE_STR, "周三"),
/**
* 4-周四
*/
FOUR(NumConstant.FOUR_STR, "周四"),
/**
* 5-周五
*/
FIVE(NumConstant.FIVE_STR, "周五"),
/**
* 6-周六
*/
SIX(NumConstant.SIX_STR, "周六"),
/**
* 7-周天
*/
SEVEN(NumConstant.SEVEN_STR, "周天");
private String key;
private String value;
DayOfWeekEnum(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
/**
* 根据key获取value
*
* @param key
* @return com.elink.esua.epdc.enums.AppNewsLikeEnum
* @author zhangyong
* @date 2020-06-17
*/
public static String getEnumByKey(String key) {
DayOfWeekEnum[] enums = DayOfWeekEnum.values();
for (DayOfWeekEnum anEnum : enums) {
if (anEnum.getKey().equals(key)) {
return anEnum.getValue();
}
}
return null;
}
}

92
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideController.java

@ -0,0 +1,92 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.PartyGroupGuideDTO;
import com.elink.esua.epdc.excel.PartyGroupGuideExcel;
import com.elink.esua.epdc.service.PartyGroupGuideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 党群指南
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("partygroupguide")
public class PartyGroupGuideController {
@Autowired
private PartyGroupGuideService partyGroupGuideService;
@GetMapping("page")
public Result<PageData<PartyGroupGuideDTO>> page(@RequestParam Map<String, Object> params){
PageData<PartyGroupGuideDTO> page = partyGroupGuideService.page(params);
return new Result<PageData<PartyGroupGuideDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PartyGroupGuideDTO> get(@PathVariable("id") String id){
PartyGroupGuideDTO data = partyGroupGuideService.get(id);
return new Result<PartyGroupGuideDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PartyGroupGuideDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return partyGroupGuideService.save(dto);
}
@PutMapping
public Result update(@RequestBody PartyGroupGuideDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
return partyGroupGuideService.update(dto);
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
partyGroupGuideService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PartyGroupGuideDTO> list = partyGroupGuideService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PartyGroupGuideExcel.class);
}
}

94
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupGuideRelationController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO;
import com.elink.esua.epdc.excel.PartyGroupGuideRelationExcel;
import com.elink.esua.epdc.service.PartyGroupGuideRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 党群指南关系表
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@RestController
@RequestMapping("partygroupguiderelation")
public class PartyGroupGuideRelationController {
@Autowired
private PartyGroupGuideRelationService partyGroupGuideRelationService;
@GetMapping("page")
public Result<PageData<PartyGroupGuideRelationDTO>> page(@RequestParam Map<String, Object> params){
PageData<PartyGroupGuideRelationDTO> page = partyGroupGuideRelationService.page(params);
return new Result<PageData<PartyGroupGuideRelationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PartyGroupGuideRelationDTO> get(@PathVariable("id") String id){
PartyGroupGuideRelationDTO data = partyGroupGuideRelationService.get(id);
return new Result<PartyGroupGuideRelationDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PartyGroupGuideRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
partyGroupGuideRelationService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PartyGroupGuideRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
partyGroupGuideRelationService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
partyGroupGuideRelationService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PartyGroupGuideRelationDTO> list = partyGroupGuideRelationService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PartyGroupGuideRelationExcel.class);
}
}

54
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideDao.java

@ -0,0 +1,54 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PartyGroupGuideDTO;
import com.elink.esua.epdc.entity.PartyGroupGuideEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 党群指南
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface PartyGroupGuideDao extends BaseDao<PartyGroupGuideEntity> {
/**
* 党群指南 首页查询
* @param params
* @return java.util.List<com.elink.esua.epdc.dto.PartyGroupGuideDTO>
* @Author zhangyong
* @Date 08:44 2020-06-17
**/
List<PartyGroupGuideDTO> selectListPartyGroupGuidePage(Map<String, Object> params);
/**
* 拿周几查指南表 取出指南ID
* @param dayOfWeek
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 09:35 2020-06-17
**/
List<String> selectPartyGroupGuideByDayOfWeek(String dayOfWeek);
}

64
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupGuideRelationDao.java

@ -0,0 +1,64 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 党群指南关系表
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Mapper
public interface PartyGroupGuideRelationDao extends BaseDao<PartyGroupGuideRelationEntity> {
/**
* 根据 党群指南表ID 删除 党群指南表与党群的关联
* @param partyGroupGuideId, delFlag
* @return void
* @Author zhangyong
* @Date 08:22 2020-06-17
**/
void deletePartyGroupGuideRelation(@Param("partyGroupGuideId") String partyGroupGuideId, @Param("delFlag") String delFlag);
/**
* 根据 党群指南表ID 查询 相关联的 社群id
* @param partyGroupGuideId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 09:08 2020-06-17
**/
List<String> selectListPartyGroupIdList(String partyGroupGuideId);
/**
* 根据 指南ID+党群ID查党群指南关系表
* 返回党群名称逗号分隔
* @param map
* @return java.lang.String
* @Author zhangyong
* @Date 09:41 2020-06-17
**/
String selectPartyGroupName(Map<String, Object> map);
}

51
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideEntity.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 党群指南
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_party_group_guide")
public class PartyGroupGuideEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 内容
*/
private String content;
/**
* 显示时间1-周一2-周二3-周三4-周四5-周五6-周六7-周日
*/
private String dayOfWeek;
}

51
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupGuideRelationEntity.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 党群指南关系表
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_party_group_guide_relation")
public class PartyGroupGuideRelationEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 党群ID
*/
private String partyGroupId;
/**
* 党群指南表ID
*/
private String partyGroupGuideId;
}

62
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 党群指南
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class PartyGroupGuideExcel {
@Excel(name = "ID")
private String id;
@Excel(name = "内容")
private String content;
@Excel(name = "显示时间:1-周一,2-周二,3-周三,4-周四,5-周五,6-周六,7-周日")
private String dayOfWeek;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "删除标识(0-否,1-是)")
private String delFlag;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

62
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/excel/PartyGroupGuideRelationExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 党群指南关系表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Data
public class PartyGroupGuideRelationExcel {
@Excel(name = "ID")
private String id;
@Excel(name = "党群ID")
private String partyGroupId;
@Excel(name = "党群指南表ID")
private String partyGroupGuideId;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "删除标识(0-否,1-是)")
private String delFlag;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 党群指南
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class PartyGroupGuideRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/redis/PartyGroupGuideRelationRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 党群指南关系表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2020-06-16
*/
@Component
public class PartyGroupGuideRelationRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

123
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideRelationService.java

@ -0,0 +1,123 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO;
import com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity;
import java.util.List;
import java.util.Map;
/**
* 党群指南关系表
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
public interface PartyGroupGuideRelationService extends BaseService<PartyGroupGuideRelationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PartyGroupGuideRelationDTO>
* @author generator
* @date 2020-06-16
*/
PageData<PartyGroupGuideRelationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PartyGroupGuideRelationDTO>
* @author generator
* @date 2020-06-16
*/
List<PartyGroupGuideRelationDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PartyGroupGuideRelationDTO
* @author generator
* @date 2020-06-16
*/
PartyGroupGuideRelationDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void save(PartyGroupGuideRelationDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-16
*/
void update(PartyGroupGuideRelationDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
/**
* 根据 党群指南表ID 删除/恢复 党群指南表与党群的关联
* @param partyGroupGuideId, delFlag
* @return void
* @Author zhangyong
* @Date 08:22 2020-06-17
**/
void deleteAllPartyGroupGuideRelation(String partyGroupGuideId, String delFlag);
/**
* 根据 党群指南表ID 查询 相关联的 社群id
* @param partyGroupGuideId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 09:08 2020-06-17
**/
List<String> listPartyGroupIdList(String partyGroupGuideId);
/**
* 根据 指南ID+党群ID查党群指南关系表
* 返回党群名称逗号分隔
* @param map
* @return java.lang.String
* @Author zhangyong
* @Date 09:41 2020-06-17
**/
String listPartyGroupName(Map<String, Object> map);
}

96
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupGuideService.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.PartyGroupGuideDTO;
import com.elink.esua.epdc.entity.PartyGroupGuideEntity;
import java.util.List;
import java.util.Map;
/**
* 党群指南
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
public interface PartyGroupGuideService extends BaseService<PartyGroupGuideEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PartyGroupGuideDTO>
* @author generator
* @date 2020-06-16
*/
PageData<PartyGroupGuideDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PartyGroupGuideDTO>
* @author generator
* @date 2020-06-16
*/
List<PartyGroupGuideDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PartyGroupGuideDTO
* @author generator
* @date 2020-06-16
*/
PartyGroupGuideDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return Result
* @author generator
* @date 2020-06-16
*/
Result save(PartyGroupGuideDTO dto);
/**
* 默认更新
*
* @param dto
* @return Result
* @author generator
* @date 2020-06-16
*/
Result update(PartyGroupGuideDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-16
*/
void delete(String[] ids);
}

119
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideRelationServiceImpl.java

@ -0,0 +1,119 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.dao.PartyGroupGuideRelationDao;
import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO;
import com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity;
import com.elink.esua.epdc.redis.PartyGroupGuideRelationRedis;
import com.elink.esua.epdc.service.PartyGroupGuideRelationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 党群指南关系表
*
* @author zhangyong
* @since v1.0.0 2020-06-16
*/
@Service
public class PartyGroupGuideRelationServiceImpl extends BaseServiceImpl<PartyGroupGuideRelationDao, PartyGroupGuideRelationEntity> implements PartyGroupGuideRelationService {
@Autowired
private PartyGroupGuideRelationRedis partyGroupGuideRelationRedis;
@Override
public PageData<PartyGroupGuideRelationDTO> page(Map<String, Object> params) {
IPage<PartyGroupGuideRelationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PartyGroupGuideRelationDTO.class);
}
@Override
public List<PartyGroupGuideRelationDTO> list(Map<String, Object> params) {
List<PartyGroupGuideRelationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PartyGroupGuideRelationDTO.class);
}
private QueryWrapper<PartyGroupGuideRelationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartyGroupGuideRelationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PartyGroupGuideRelationDTO get(String id) {
PartyGroupGuideRelationEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PartyGroupGuideRelationDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PartyGroupGuideRelationDTO dto) {
PartyGroupGuideRelationEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideRelationEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PartyGroupGuideRelationDTO dto) {
PartyGroupGuideRelationEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideRelationEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void deleteAllPartyGroupGuideRelation(String partyGroupGuideId, String delFlag) {
baseDao.deletePartyGroupGuideRelation(partyGroupGuideId, delFlag);
}
@Override
public List<String> listPartyGroupIdList(String partyGroupGuideId) {
return baseDao.selectListPartyGroupIdList(partyGroupGuideId);
}
@Override
public String listPartyGroupName(Map<String, Object> map) {
return baseDao.selectPartyGroupName(map);
}
}

181
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupGuideServiceImpl.java

@ -0,0 +1,181 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dao.PartyGroupGuideDao;
import com.elink.esua.epdc.dto.PartyGroupGuideDTO;
import com.elink.esua.epdc.dto.PartyGroupGuideRelationDTO;
import com.elink.esua.epdc.dto.enums.DayOfWeekEnum;
import com.elink.esua.epdc.entity.PartyGroupGuideEntity;
import com.elink.esua.epdc.redis.PartyGroupGuideRedis;
import com.elink.esua.epdc.service.PartyGroupGuideRelationService;
import com.elink.esua.epdc.service.PartyGroupGuideService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 党群指南
*
* @authorzhangyong
* @since v1.0.0 2020-06-16
*/
@Service
public class PartyGroupGuideServiceImpl extends BaseServiceImpl<PartyGroupGuideDao, PartyGroupGuideEntity> implements PartyGroupGuideService {
@Autowired
private PartyGroupGuideRedis partyGroupGuideRedis;
@Autowired
private PartyGroupGuideRelationService partyGroupGuideRelationService;
@Override
public PageData<PartyGroupGuideDTO> page(Map<String, Object> params) {
IPage<PartyGroupGuideEntity> page = getPage(params);
List<PartyGroupGuideDTO> list = baseDao.selectListPartyGroupGuidePage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<PartyGroupGuideDTO> list(Map<String, Object> params) {
List<PartyGroupGuideEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PartyGroupGuideDTO.class);
}
private QueryWrapper<PartyGroupGuideEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartyGroupGuideEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PartyGroupGuideDTO get(String id) {
PartyGroupGuideEntity entity = baseDao.selectById(id);
// 查询 关联的党群名称
PartyGroupGuideDTO dto = ConvertUtils.sourceToTarget(entity, PartyGroupGuideDTO.class);
dto.setPartyGroupIdList(partyGroupGuideRelationService.listPartyGroupIdList(id));
return dto;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result save(PartyGroupGuideDTO dto) {
// 判断是否插入
StringBuffer partyGroupName = this.partyGroupOpertionLimit(dto);
if (null != partyGroupName && partyGroupName.length() > 0){
return new Result().error("[" + partyGroupName + "]在" + DayOfWeekEnum.getEnumByKey(dto.getDayOfWeek()) + "已存在党群指南");
}
// 保存到党群指南表
PartyGroupGuideEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideEntity.class);
insert(entity);
// 保存到党群指南关联表
dto.setId(entity.getId());
this.savePartyGroupGuideRelation(dto);
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result update(PartyGroupGuideDTO dto) {
// 删除 党群指南关联表
partyGroupGuideRelationService.deleteAllPartyGroupGuideRelation(dto.getId(), NumConstant.ONE_STR);
// 判断是否修改
StringBuffer partyGroupName = this.partyGroupOpertionLimit(dto);
if (null != partyGroupName && partyGroupName.length() > 0){
// 如果存在,则恢复 党群指南关联关系
partyGroupGuideRelationService.deleteAllPartyGroupGuideRelation(dto.getId(), NumConstant.ZERO_STR);
return new Result().error("[" + partyGroupName + "]在" + DayOfWeekEnum.getEnumByKey(dto.getDayOfWeek()) + "已存在党群指南");
}
// 修改党群指南表
PartyGroupGuideEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupGuideEntity.class);
updateById(entity);
// 重新保存到党群指南关联表
this.savePartyGroupGuideRelation(dto);
return new Result();
}
/**
* 保存到 党群指南关联表
* @param dto
* @return void
* @Author zhangyong
* @Date 18:28 2020-06-16
**/
private void savePartyGroupGuideRelation(PartyGroupGuideDTO dto){
for (int i = 0; i < dto.getPartyGroupIdList().size(); i++){
PartyGroupGuideRelationDTO partyGroupGuideRelation = new PartyGroupGuideRelationDTO();
partyGroupGuideRelation.setPartyGroupId(dto.getPartyGroupIdList().get(i));
partyGroupGuideRelation.setPartyGroupGuideId(dto.getId());
partyGroupGuideRelationService.save(partyGroupGuideRelation);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
// 先删除 党群指南表
baseDao.deleteBatchIds(Arrays.asList(ids));
// 在删除 党群指南关联表
partyGroupGuideRelationService.deleteAllPartyGroupGuideRelation(ids[0], NumConstant.ONE_STR);
}
/**
* 限制 一个党群一天只有一条指南
* @param dto
* @return java.lang.StringBuffer
* @Author zhangyong
* @Date 09:30 2020-06-17
**/
private StringBuffer partyGroupOpertionLimit(PartyGroupGuideDTO dto){
StringBuffer stringBuffer = new StringBuffer();
// 一个党群一天只有一条指南,拿周几查指南表,为空跳过,有,取出指南ID,
List<String> dayOfWeekList = baseDao.selectPartyGroupGuideByDayOfWeek(dto.getDayOfWeek());
if (dayOfWeekList != null && dayOfWeekList.size() > NumConstant.ZERO){
// 指南ID,+党群ID查党群指南关系表,没有,跳过,有一个有的:提示某某某党群已存在周几显示的指南
for (String guideId : dayOfWeekList){
Map<String,Object> map = new HashMap<>();
map.put("partyGroupGuideId", guideId);
map.put("partyGroupIdList",dto.getPartyGroupIdList());
String partyGroupName = partyGroupGuideRelationService.listPartyGroupName(map);
if (null != partyGroupName){
stringBuffer.append(partyGroupName);
}
}
}
return stringBuffer;
}
}

49
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideDao.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.PartyGroupGuideDao">
<resultMap type="com.elink.esua.epdc.entity.PartyGroupGuideEntity" id="partyGroupGuideMap">
<result property="id" column="ID"/>
<result property="content" column="CONTENT"/>
<result property="dayOfWeek" column="DAY_OF_WEEK"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListPartyGroupGuidePage" resultType="com.elink.esua.epdc.dto.PartyGroupGuideDTO">
SELECT
g.ID,
g.CONTENT,
g.DAY_OF_WEEK,
GROUP_CONCAT(pg.id SEPARATOR ',') partyGroupId,
GROUP_CONCAT(pg.PARTY_GROUP_NAME SEPARATOR ',') partyGroupName,
g.CREATED_TIME,
g.UPDATED_TIME
FROM
epdc_party_group_guide g
LEFT JOIN epdc_party_group_guide_relation gr ON g.id = gr.PARTY_GROUP_GUIDE_ID
LEFT JOIN epdc_party_group pg ON gr.PARTY_GROUP_ID = pg.id
WHERE g.DEL_FLAG = 0 and gr.DEL_FLAG = 0
<if test="dayOfWeek != null and dayOfWeek != '' ">
and g.DAY_OF_WEEK = #{dayOfWeek}
</if>
GROUP BY g.ID
<if test="partyGroupId != null and partyGroupId != '' ">
HAVING instr(GROUP_CONCAT(pg.id SEPARATOR ',') , #{partyGroupId}) >0
</if>
ORDER BY CREATED_TIME DESC
</select>
<select id="selectPartyGroupGuideByDayOfWeek" resultType="String">
SELECT
ID
FROM epdc_party_group_guide
WHERE DAY_OF_WEEK = #{dayOfWeek}
AND DEL_FLAG = 0
</select>
</mapper>

49
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupGuideRelationDao.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.PartyGroupGuideRelationDao">
<resultMap type="com.elink.esua.epdc.entity.PartyGroupGuideRelationEntity" id="partyGroupGuideRelationMap">
<result property="id" column="ID"/>
<result property="partyGroupId" column="PARTY_GROUP_ID"/>
<result property="partyGroupGuideId" column="PARTY_GROUP_GUIDE_ID"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deletePartyGroupGuideRelation">
update epdc_party_group_guide_relation
set DEL_FLAG = #{delFlag}
where PARTY_GROUP_GUIDE_ID =#{partyGroupGuideId}
</delete>
<select id="selectListPartyGroupIdList" resultType="String">
SELECT
PARTY_GROUP_ID
FROM epdc_party_group_guide_relation
WHERE PARTY_GROUP_GUIDE_ID = #{partyGroupGuideId}
and DEL_FLAG='0'
</select>
<select id="selectPartyGroupName" resultType="String">
SELECT
GROUP_CONCAT(pg.PARTY_GROUP_NAME SEPARATOR ',') partyGroupName
FROM epdc_party_group_guide_relation gr
LEFT JOIN epdc_party_group pg ON gr.PARTY_GROUP_ID = pg.id
WHERE gr.DEL_FLAG = 0
<if test="partyGroupIdList!=null and partyGroupIdList.size()>0">
AND gr.PARTY_GROUP_ID IN
<foreach collection="partyGroupIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
<if test="partyGroupGuideId != null and partyGroupGuideId != ''">
AND gr.PARTY_GROUP_GUIDE_ID = #{partyGroupGuideId}
</if>
GROUP BY gr.PARTY_GROUP_GUIDE_ID
</select>
</mapper>
Loading…
Cancel
Save