| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | |
| | | @ApiOperation(value = "分页查询邻里圈列表" , response = ComActNeighborCircleAppVO.class) |
| | | @PostMapping("pageApp") |
| | |
| | | public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | LoginUserInfoVO loginUser = this.getLoginUserInfo(); |
| | | Long userId = loginUser.getUserId(); |
| | | Long communityId = loginUser.getCommunityId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登录"); |
| | | } |
| | |
| | | if(StringUtils.isNotEmpty(loginUser.getPhone())){ |
| | | addNeighborCircleAppDTO.setPhone(this.getLoginUserInfo().getPhone()); |
| | | } |
| | | if(loginUser.getCommunityId() != null){ |
| | | addNeighborCircleAppDTO.setCommunityId(loginUser.getCommunityId()); |
| | | if(communityId != null){ |
| | | addNeighborCircleAppDTO.setCommunityId(communityId); |
| | | } |
| | | |
| | | //查询社区自动审核是否开着 |
| | | String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; |
| | | R isOk = communityService.getSysConfValue(key + communityId,communityId); |
| | | if(R.isOk(isOk)){ |
| | | if(isOk.getData() != null){ |
| | | String value = isOk.getData().toString(); |
| | | if(value.equals("1")){ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | String msg = addNeighborCircleAppDTO.getReleaseContent(); |
| | | if (checkService.checkMessage(msg)) { |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | }else{ |
| | | addNeighborCircleAppDTO.setWxExamineResult(AddComActNeighborCircleAppDTO.isExamine.no); |
| | | } |
| | | }else{ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | }else{ |
| | | communityService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","2"); |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | }else{ |
| | | addNeighborCircleAppDTO.setIsExamine(AddComActNeighborCircleAppDTO.isExamine.yes); |
| | | } |
| | | |
| | | return communityService.addNeighborByApp(addNeighborCircleAppDTO); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "查询社区邻里圈话题列表" , response = ComActNeighborCircleTopicAppVO.class) |
| | | @GetMapping("topic/list") |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId) { |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId,@RequestParam(value = "isZero",defaultValue = "2",required = false) Integer isZero) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo != null){ |
| | | communityId = loginUserInfo.getCommunityId(); |
| | | } |
| | | return communityService.getNeighborTopicByApp(communityId); |
| | | if(isZero == null){ |
| | | isZero = 2; |
| | | } |
| | | return communityService.getNeighborTopicByApp(communityId,isZero); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户新增邻里圈话题") |
| | | @PostMapping("topic/add") |
| | | public R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail(401,"请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户删除邻里圈") |
| | | @PostMapping("delete") |
| | | public R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail(401,"请先登录"); |
| | | } |
| | | circleTopicAppDTO.setUserId(loginUserInfo.getUserId()); |
| | | circleTopicAppDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | return communityService.deleteNeighborByApp(circleTopicAppDTO); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.constants; |
| | | |
| | | /** |
| | | * 邻里圈常量类 |
| | | */ |
| | | public class NeighborCircleConstants { |
| | | |
| | | /** |
| | | * 浏览变动热度值 |
| | | */ |
| | | public static final Long VIEW_HOT_NUM = 1L; |
| | | /** |
| | | * 点赞变动热度值 |
| | | */ |
| | | public static final Long FABULOUS_HOT_NUM = 2L; |
| | | /** |
| | | * 评论变动热度值 |
| | | */ |
| | | public static final Long COMMENT_HOT_NUM = 3L; |
| | | |
| | | /** |
| | | * 邻里圈自动审核状态KEY(value:1.自动审核 2.需要社区审核) |
| | | */ |
| | | public static final String NEIGHBOR_CIRCLE_AUTO_EXAMINE = "NEIGHBOR_CIRCLE_AUTO_EXAMINE_"; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "是否需要审核(1.是 2.否)",hidden = true) |
| | | private Integer isExamine; |
| | | |
| | | @ApiModelProperty(value = "微信审核结果(1.通过 2.拒绝)",hidden = true) |
| | | private Integer wxExamineResult; |
| | | |
| | | /** |
| | | * 是否需要审核(1.是 2.否) |
| | | */ |
| | | public interface isExamine{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.neighbor; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 用户添加邻里圈请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("用户添加邻里圈请求参数") |
| | | public class AddNeighborCircleTopicAppDTO { |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("邻里圈话题名称") |
| | | private String name; |
| | | } |
| | |
| | | @ApiModelProperty("话题名称") |
| | | private String topicName; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.neighbor; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 用户删除邻里圈请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("用户删除邻里圈请求参数") |
| | | public class DeleteNeighborCircleAppDTO { |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("邻里圈id") |
| | | private Long id; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("话题id") |
| | | private String topicId; |
| | | |
| | | @ApiModelProperty("热度") |
| | | private Long hotNum; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.neighbor; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @ApiModelProperty("话题名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("热度") |
| | | private Long hotNum; |
| | | |
| | | @ApiModelProperty("邻里圈数量") |
| | | private Integer count; |
| | | |
| | | } |
| | |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @GetMapping("/neighbor/getNeighborTopicByApp") |
| | | R getNeighborTopicByApp(@RequestParam("communityId") Long communityId); |
| | | R getNeighborTopicByApp(@RequestParam("communityId") Long communityId,@RequestParam("isZero") Integer isZero); |
| | | |
| | | /** |
| | | * 综治后台-查询社区列表 |
| | |
| | | */ |
| | | @GetMapping("/reserve/admin/register/detailed/detail") |
| | | R registerDetailedDetailAdmin(@RequestParam("reserveRecordId") Long reserveRecordId); |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/neighbor/addNeighborTopicByApp") |
| | | R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO); |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/neighbor/circleTopicAppDTO") |
| | | R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO); |
| | | |
| | | /** |
| | | * 获取系统配置value |
| | | * @param key 系统配置code |
| | | * @param communityId 社区id |
| | | * @return 系统配置value |
| | | */ |
| | | @GetMapping("/sys/conf/getSysConfValue") |
| | | R getSysConfValue(@RequestParam("key") String key,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 新增系统配置 |
| | | * @param key 系统配置code |
| | | * @param communityId 社区id |
| | | * @param name 系统配置名称 |
| | | * @param value 系统配置value |
| | | * @return 新增结果 |
| | | */ |
| | | @GetMapping("/sys/conf/addSysConfValue") |
| | | R addSysConfValue(@RequestParam("key") String key,@RequestParam("communityId") Long communityId,@RequestParam("name") String name,@RequestParam("value") String value); |
| | | } |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | |
| | | return communityService.editNeighborTopicByAdmin(addCircleTopicAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取社区审核状态") |
| | | @GetMapping("getCircleExamineStatus") |
| | | public R getCircleExamineStatus(){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请先登录"); |
| | | } |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //查询社区自动审核是否开着 |
| | | String key = NeighborCircleConstants.NEIGHBOR_CIRCLE_AUTO_EXAMINE; |
| | | R isOk = communityService.getSysConfValue(key + communityId,communityId); |
| | | if(R.isOk(isOk)){ |
| | | if(isOk.getData() != null){ |
| | | return isOk; |
| | | }else{ |
| | | communityService.addSysConfValue(key + communityId,communityId,"社区邻里圈自动审核参数","2"); |
| | | isOk.setData("2"); |
| | | return isOk; |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @GetMapping("getNeighborTopicByApp") |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId) { |
| | | return comActNeighborCircleTopicService.getNeighborTopicByApp(communityId); |
| | | public R getNeighborTopicByApp(@RequestParam("communityId") Long communityId,@RequestParam("isZero") Integer isZero) { |
| | | return comActNeighborCircleTopicService.getNeighborTopicByApp(communityId,isZero); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addNeighborTopicByApp") |
| | | public R addNeighborTopicByApp(@RequestBody AddNeighborCircleTopicAppDTO circleTopicAppDTO){ |
| | | return comActNeighborCircleTopicService.addNeighborTopicByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deleteNeighborByApp") |
| | | public R deleteNeighborByApp(@RequestBody DeleteNeighborCircleAppDTO circleTopicAppDTO){ |
| | | return comActNeighborCircleService.deleteNeighborByApp(circleTopicAppDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | return R.ok(value); |
| | | } |
| | | |
| | | @GetMapping("getSysConfValue") |
| | | public R getSysConfValue(@RequestParam("key") String key,@RequestParam("communityId") Long communityId) { |
| | | return sysConfService.getSysConfValue(key,communityId); |
| | | } |
| | | |
| | | @GetMapping("addSysConfValue") |
| | | public R addSysConfValue(@RequestParam("key") String key,@RequestParam("communityId") Long communityId,@RequestParam("name") String name,@RequestParam("value") String value) { |
| | | return sysConfService.addSysConfValue(key,communityId,name,value); |
| | | } |
| | | } |
| | |
| | | @Mapper |
| | | public interface ComActNeighborCircleDAO extends BaseMapper<ComActNeighborCircleDO> { |
| | | |
| | | @Select("<script> " + |
| | | "SELECT " + |
| | | "canc.id," + |
| | | "canc.release_content," + |
| | | "canc.release_images," + |
| | | "canc.comment_num," + |
| | | "canc.fabulous_num," + |
| | | "canc.forward_num," + |
| | | "canc.views_num," + |
| | | "canc.is_boutique," + |
| | | "canc.create_at," + |
| | | "canc.reply_at," + |
| | | "canc.last_comment_num," + |
| | | "canc.last_fabulous_num," + |
| | | "canc.last_views_num," + |
| | | "canc.type," + |
| | | "canc.topic_id," + |
| | | "su.nick_name as name," + |
| | | "su.community_id," + |
| | | "canct.name as topicName," + |
| | | "su.image_url as headUrl " + |
| | | " FROM " + |
| | | " com_act_neighbor_circle AS canc" + |
| | | " left join sys_user as su on su.user_id = canc.release_id " + |
| | | " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id " + |
| | | " where canc.status = 2 and canc.community_id = #{neighborCircleAppDTO.communityId} " + |
| | | "<if test='neighborCircleAppDTO.topicId != null '>" + |
| | | " and canc.topic_id = #{neighborCircleAppDTO.topicId} " + |
| | | " </if> " + |
| | | "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 1'>" + |
| | | " order by (canc.last_views_num + canc.last_comment_num + canc.last_fabulous_num) desc " + |
| | | " </if> " + |
| | | "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 2'>" + |
| | | " order by canc.create_at desc " + |
| | | " </if> " + |
| | | "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 3'>" + |
| | | " order by (canc.views_num + canc.comment_num + canc.fabulous_num) desc " + |
| | | " </if> " + |
| | | " </script>") |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | IPage<ComActNeighborCircleAppVO> pageNeighborByApp(Page page, @Param("neighborCircleAppDTO") ComActNeighborCircleAppDTO neighborCircleAppDTO); |
| | | |
| | | @Select("<script> " + |
| | |
| | | " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id where canc.id = #{circleId}" + |
| | | " </script>") |
| | | ComActNeighborCircleDetailAppVO neighborDetailByApp(@Param("circleId") Long circleId); |
| | | @Select("<script> \n"+ |
| | | "SELECT\n" + |
| | | "nc.*,\n" + |
| | | "u.`nick_name` AS releaseName,u.image_url,canct.`name` as topicName ,u.`type` as userType\n" + |
| | | ",u.name as communityName\n" + |
| | | "FROM\n" + |
| | | "com_act_neighbor_circle nc\n" + |
| | | "LEFT JOIN sys_user u ON nc.release_id = u.user_id \n" + |
| | | "LEFT JOIN com_act_neighbor_circle_topic as canct ON canct.id = nc.topic_id \n" + |
| | | "<where>"+ |
| | | "nc.community_id = #{neighborCircleAdminDTO.communityId} \n"+ |
| | | "<if test='neighborCircleAdminDTO.releaseContent != null and neighborCircleAdminDTO.releaseContent != ""'>" + |
| | | "and nc.release_content like concat('%',#{neighborCircleAdminDTO.releaseContent},'%') \n" + |
| | | " </if> " + |
| | | "<if test='neighborCircleAdminDTO.topicName != null and neighborCircleAdminDTO.topicName != ""'>" + |
| | | "and canct.`name` = #{neighborCircleAdminDTO.topicName} " + |
| | | " </if> " + |
| | | "<if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '>" + |
| | | "and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt} \n" + |
| | | " </if> " + |
| | | "<if test='neighborCircleAdminDTO.status != null '>" + |
| | | "and nc.status = #{neighborCircleAdminDTO.status} \n" + |
| | | " </if> " + |
| | | "</where>"+ |
| | | "order by " + |
| | | "case when nc.`status`=1 then 0 else 1 end, \n" + |
| | | "nc.`status` asc,nc.create_at desc " + |
| | | "</script>") |
| | | |
| | | IPage<ComActNeighborCircleAdminVO> pageNeighborByAdmin(Page page,@Param("neighborCircleAdminDTO") ComActNeighborCircleAdminDTO neighborCircleAdminDTO); |
| | | |
| | | @Select("select * from sys_user where user_id=#{userId}") |
| | |
| | | " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + |
| | | " )AS b ") |
| | | Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); |
| | | |
| | | void addHotNum(@Param("circleId") Long circleId,@Param("hotNum") Long hotNum); |
| | | |
| | | void addTopicHotNum(@Param("circleId") Long circleId,@Param("hotNum") Long hotNum); |
| | | } |
| | |
| | | * @param communityId 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | List<ComActNeighborCircleTopicAppVO> getNeighborTopicByApp(@Param("communityId") Long communityId); |
| | | List<ComActNeighborCircleTopicAppVO> getNeighborTopicByApp(@Param("communityId") Long communityId,@Param("isZero") Integer isZero); |
| | | |
| | | /** |
| | | * 添加邻里圈话题热度 |
| | | * @param circleTopicId 邻里圈话题id |
| | | * @param hotNum 热度值 |
| | | */ |
| | | void addHotNum(@Param("circleTopicId") Long circleTopicId,@Param("hotNum") Long hotNum); |
| | | |
| | | /** |
| | | * 添加邻里圈话题邻里圈数量 |
| | | * @param circleTopicId 邻里圈话题id |
| | | */ |
| | | void addCount(@Param("circleTopicId") Long circleTopicId); |
| | | } |
| | |
| | | */ |
| | | IPage<SysConfVO> findByPage(Page page, @Param("pageSysConfDTO")PageSysConfDTO pageSysConfDTO); |
| | | |
| | | String getSysConfValue(@Param("key")String key,@Param("communityId") Long communityId); |
| | | |
| | | } |
| | |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 热度 |
| | | */ |
| | | private Long hotNum; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | /** |
| | | * 发布状态(1.待审核 2.显示 3.隐藏 4.驳回) |
| | | */ |
| | | public interface status{ |
| | |
| | | int admin = 2; |
| | | } |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | public interface isDel{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleDO{" + |
| | |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 热度 |
| | | */ |
| | | private Long hotNum; |
| | | |
| | | /** |
| | | * 邻里圈数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 状态(1.启用 2.禁用) |
| | | */ |
| | | public interface status{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleTopicDO{" + |
| | |
| | | */ |
| | | R neighborCommentReplyByApp(ComActNeighborCommentReplyAppDTO commentReplyAppDTO); |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteNeighborByApp(DeleteNeighborCircleAppDTO circleTopicAppDTO); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DeleteNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicDO; |
| | | |
| | |
| | | * @param communityId 社区id |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | R getNeighborTopicByApp(Long communityId); |
| | | R getNeighborTopicByApp(Long communityId,Integer isZero); |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | R addNeighborTopicByApp(AddNeighborCircleTopicAppDTO circleTopicAppDTO); |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.SysConfDO; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface SysConfService extends IService<SysConfDO> { |
| | | |
| | | /** |
| | | * 根据系统code以及社区id查询配置表value值 |
| | | * @param key 系统code |
| | | * @param communityId 社区id |
| | | * @return 系统配置value值 |
| | | */ |
| | | R getSysConfValue(String key, Long communityId); |
| | | |
| | | /** |
| | | * 新增系统code配置数据 |
| | | * @param key 系统code |
| | | * @param communityId 社区id |
| | | * @return 新增结果 |
| | | */ |
| | | R addSysConfValue(String key, Long communityId,String name,String value); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.constants.NeighborCircleConstants; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.*; |
| | |
| | | if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())){ |
| | | neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone()); |
| | | } |
| | | //判断当前邻里圈是否需要审核 |
| | | if(addNeighborCircleAppDTO.getIsExamine().equals(AddComActNeighborCircleAppDTO.isExamine.no)){ |
| | | //当邻里圈不需要审核才进入自动审核 |
| | | //判断邻里圈自动审核结果 |
| | | if(addNeighborCircleAppDTO.getWxExamineResult().equals(AddComActNeighborCircleAppDTO.isExamine.yes)){ |
| | | neighborCircleDO.setStatus(ComActNeighborCircleDO.status.xs); |
| | | if(neighborCircleDO.getTopicId() != null){ |
| | | //给邻里圈话题添加邻里圈数量 |
| | | comActNeighborCircleTopicMapper.addCount(neighborCircleDO.getTopicId()); |
| | | } |
| | | }else{ |
| | | neighborCircleDO.setStatus(ComActNeighborCircleDO.status.bh); |
| | | neighborCircleDO.setRefuseReason("内容违规"); |
| | | } |
| | | } |
| | | |
| | | if(this.baseMapper.insert(neighborCircleDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | |
| | | neighborCircleDO.setRefuseReason(editVO.getRefuseReason()); |
| | | } |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | if(editVO.getStatus().equals(EditNeighborCircleAdminVO.status.xs) && neighborCircleDO.getTopicId() != null){ |
| | | //给邻里圈话题添加邻里圈数量 |
| | | comActNeighborCircleTopicMapper.addCount(neighborCircleDO.getTopicId()); |
| | | } |
| | | return R.ok(neighborCircleDO.getReleaseId()); |
| | | } |
| | | |
| | |
| | | if(neighborCircleDO != null){ |
| | | neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() + 1); |
| | | neighborCircleDO.setViewsNum(neighborCircleDO.getViewsNum() + 1); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM + NeighborCircleConstants.VIEW_HOT_NUM; |
| | | neighborCircleDO.setHotNum(neighborCircleDO.getHotNum() + hotNum); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | comActNeighborCircleTopicMapper.addHotNum(neighborCircleDO.getTopicId(),hotNum); |
| | | circleFabulousDO.setCircleId(neighborCircleDO.getId()); |
| | | } |
| | | //添加邻里圈浏览记录 |
| | |
| | | if(circleCommentDO != null){ |
| | | circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1); |
| | | comActNeighborCircleCommentDAO.updateById(circleCommentDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM + NeighborCircleConstants.VIEW_HOT_NUM; |
| | | this.baseMapper.addTopicHotNum(circleCommentDO.getCircleId(),hotNum); |
| | | this.baseMapper.addHotNum(circleCommentDO.getCircleId(),hotNum); |
| | | circleFabulousDO.setCircleId(circleCommentDO.getCircleId()); |
| | | } |
| | | }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){ |
| | |
| | | if(circleCommentReplyDO != null){ |
| | | circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() + 1); |
| | | comActNeighborCircleCommentReplyDAO.updateById(circleCommentReplyDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM + NeighborCircleConstants.VIEW_HOT_NUM; |
| | | this.baseMapper.addTopicHotNum(circleCommentReplyDO.getCircleId(),hotNum); |
| | | this.baseMapper.addHotNum(circleCommentReplyDO.getCircleId(),hotNum); |
| | | circleFabulousDO.setCircleId(circleCommentReplyDO.getCircleId()); |
| | | } |
| | | } |
| | |
| | | } |
| | | circleDO.setForwardNum(circleDO.getForwardNum() + 1); |
| | | if(this.baseMapper.updateById(circleDO) > 0){ |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.VIEW_HOT_NUM; |
| | | this.baseMapper.addHotNum(forwardAppDTO.getCircleId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(forwardAppDTO.getCircleId(),hotNum); |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("转发失败"); |
| | |
| | | neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); |
| | | neighborCircleDO.setReplyAt(new Date()); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.COMMENT_HOT_NUM; |
| | | this.baseMapper.addHotNum(commentAppDTO.getCircleId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(commentAppDTO.getCircleId(),hotNum); |
| | | |
| | | circleCommentDO.setCircleId(commentAppDTO.getCircleId()); |
| | | circleCommentDO.setUserId(commentAppDTO.getUserId()); |
| | |
| | | neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); |
| | | neighborCircleDO.setReplyAt(new Date()); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.COMMENT_HOT_NUM; |
| | | this.baseMapper.addHotNum(replyAppDTO.getCircleId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(replyAppDTO.getCircleId(),hotNum); |
| | | |
| | | circleCommentReplyDO.setCircleId(replyAppDTO.getCircleId()); |
| | | circleCommentReplyDO.setUserId(replyAppDTO.getUserId()); |
| | |
| | | * @return 取消点赞结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R neighborFabulousCancelByApp(ComActNeighborFabulousAppDTO fabulousAppDTO){ |
| | | ComActNeighborCircleFabulousDO circleFabulousDO = null; |
| | | //查询邻里圈点赞信息 |
| | |
| | | if(neighborCircleDO != null){ |
| | | neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() - 1); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(neighborCircleDO.getId(),-hotNum); |
| | | this.baseMapper.addTopicHotNum(neighborCircleDO.getId(),-hotNum); |
| | | } |
| | | }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)){ |
| | | circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | |
| | | if(circleCommentDO != null){ |
| | | circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() - 1); |
| | | comActNeighborCircleCommentDAO.updateById(circleCommentDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(circleCommentDO.getCircleId(),-hotNum); |
| | | this.baseMapper.addTopicHotNum(circleCommentDO.getCircleId(),-hotNum); |
| | | } |
| | | }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){ |
| | | circleFabulousDO = comActNeighborCircleFabulousDAO.selectOne( |
| | |
| | | if(circleCommentReplyDO != null){ |
| | | circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() - 1); |
| | | comActNeighborCircleCommentReplyDAO.updateById(circleCommentReplyDO); |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(circleCommentReplyDO.getCircleId(),-hotNum); |
| | | this.baseMapper.addTopicHotNum(circleCommentReplyDO.getCircleId(),-hotNum); |
| | | } |
| | | } |
| | | if(circleFabulousDO != null){ |
| | |
| | | if(neighborCircleDO != null){ |
| | | neighborCircleDO.setViewsNum(neighborCircleDO.getViewsNum() + 1); |
| | | this.baseMapper.updateById(neighborCircleDO); |
| | | |
| | | //计算需要增加的热度值 |
| | | Long hotNum = NeighborCircleConstants.FABULOUS_HOT_NUM; |
| | | this.baseMapper.addHotNum(neighborCircleDO.getId(),hotNum); |
| | | this.baseMapper.addTopicHotNum(neighborCircleDO.getId(),hotNum); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | return R.ok(neighborCircleIPage); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-删除邻里圈 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteNeighborByApp(DeleteNeighborCircleAppDTO circleTopicAppDTO){ |
| | | ComActNeighborCircleDO neighborCircleDO = new ComActNeighborCircleDO(); |
| | | neighborCircleDO.setId(circleTopicAppDTO.getId()); |
| | | neighborCircleDO.setIsDel(ComActNeighborCircleDO.isDel.yes); |
| | | if(this.baseMapper.updateById(neighborCircleDO) > 0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddNeighborCircleTopicAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.DeleteNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleTopicMapper; |
| | |
| | | * @return 邻里圈话题列表 |
| | | */ |
| | | @Override |
| | | public R getNeighborTopicByApp(Long communityId){ |
| | | return R.ok(this.baseMapper.getNeighborTopicByApp(communityId)); |
| | | public R getNeighborTopicByApp(Long communityId,Integer isZero){ |
| | | return R.ok(this.baseMapper.getNeighborTopicByApp(communityId,isZero)); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-用户新增话题 |
| | | * @param circleTopicAppDTO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R addNeighborTopicByApp(AddNeighborCircleTopicAppDTO circleTopicAppDTO){ |
| | | ComActNeighborCircleTopicDO circleTopicDO = this.baseMapper.selectOne(new QueryWrapper<ComActNeighborCircleTopicDO>() |
| | | .lambda().eq(ComActNeighborCircleTopicDO::getCommunityId,circleTopicAppDTO.getCommunityId()) |
| | | .eq(ComActNeighborCircleTopicDO::getName,circleTopicAppDTO.getName())); |
| | | if(circleTopicDO == null){ |
| | | circleTopicDO = new ComActNeighborCircleTopicDO(); |
| | | circleTopicDO.setCommunityId(circleTopicAppDTO.getCommunityId()); |
| | | circleTopicDO.setName(circleTopicAppDTO.getName()); |
| | | circleTopicDO.setCreateBy(circleTopicAppDTO.getUserId()); |
| | | circleTopicDO.setCreateAt(new Date()); |
| | | circleTopicDO.setCount(0); |
| | | circleTopicDO.setHotNum(0L); |
| | | circleTopicDO.setStatus(ComActNeighborCircleTopicDO.status.yes); |
| | | this.baseMapper.insert(circleTopicDO); |
| | | } |
| | | return R.ok(circleTopicDO); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.SysConfMapper; |
| | | import com.panzhihua.service_community.model.dos.SysConfDO; |
| | | import com.panzhihua.service_community.service.SysConfService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Service |
| | | public class SysConfServiceImpl extends ServiceImpl<SysConfMapper, SysConfDO> implements SysConfService { |
| | | |
| | | /** |
| | | * 根据系统code以及社区id查询配置表value值 |
| | | * @param key 系统code |
| | | * @param communityId 社区id |
| | | * @return 系统配置value值 |
| | | */ |
| | | @Override |
| | | public R getSysConfValue(String key, Long communityId){ |
| | | return R.ok(this.baseMapper.getSysConfValue(key,communityId)); |
| | | } |
| | | |
| | | /** |
| | | * 新增系统code配置数据 |
| | | * @param key 系统code |
| | | * @param communityId 社区id |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R addSysConfValue(String key, Long communityId,String name,String value){ |
| | | SysConfDO confDO = new SysConfDO(); |
| | | confDO.setCode(key); |
| | | confDO.setCreateAt(new Date()); |
| | | confDO.setCommunityId(communityId); |
| | | confDO.setValue(value); |
| | | confDO.setName(name); |
| | | if(this.baseMapper.insert(confDO) > 0){ |
| | | return R.ok(confDO.getValue()); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?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.panzhihua.service_community.dao.ComActNeighborCircleDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActNeighborCircleDO"> |
| | | <id column="id" property="id"/> |
| | | <result column="release_id" property="releaseId"/> |
| | | <result column="release_phone" property="releasePhone"/> |
| | | <result column="community_id" property="communityId"/> |
| | | <result column="release_content" property="releaseContent"/> |
| | | <result column="release_images" property="releaseImages"/> |
| | | <result column="status" property="status"/> |
| | | <result column="refuse_reason" property="refuseReason"/> |
| | | <result column="comment_num" property="commentNum"/> |
| | | <result column="fabulous_num" property="fabulousNum"/> |
| | | <result column="forward_num" property="forwardNum"/> |
| | | <result column="views_num" property="viewsNum"/> |
| | | <result column="is_boutique" property="isBoutique"/> |
| | | <result column="create_at" property="createAt"/> |
| | | <result column="reply_at" property="replyAt"/> |
| | | <result column="last_comment_num" property="lastCommentNum"/> |
| | | <result column="last_fabulous_num" property="lastFabulousNum"/> |
| | | <result column="last_views_num" property="lastViewsNum"/> |
| | | <result column="type" property="type"/> |
| | | <result column="topic_id" property="topicId"/> |
| | | <result column="hot_num" property="hotNum"/> |
| | | <result column="is_del" property="isDel"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, release_id, release_phone, community_id, release_content, release_images, status, refuse_reason, comment_num, fabulous_num, forward_num, views_num, is_boutique, create_at, reply_at, last_comment_num, last_fabulous_num, last_views_num, type, topic_id, hot_num, is_del |
| | | </sql> |
| | | |
| | | <select id="pageNeighborByApp" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO"> |
| | | SELECT |
| | | canc.id, |
| | | canc.release_content, |
| | | canc.release_images, |
| | | canc.comment_num, |
| | | canc.fabulous_num, |
| | | canc.forward_num, |
| | | canc.views_num, |
| | | canc.is_boutique, |
| | | canc.create_at, |
| | | canc.refuse_reason, |
| | | canc.reply_at, |
| | | canc.last_comment_num, |
| | | canc.last_fabulous_num, |
| | | canc.last_views_num, |
| | | canc.type, |
| | | canc.topic_id, |
| | | canc.hot_num, |
| | | su.nick_name as name, |
| | | su.community_id, |
| | | canct.name as topicName, |
| | | su.image_url as headUrl |
| | | FROM |
| | | com_act_neighbor_circle AS canc |
| | | left join sys_user as su on su.user_id = canc.release_id |
| | | left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id |
| | | where canc.status = 2 and is_del = 2 and canc.community_id = #{neighborCircleAppDTO.communityId} |
| | | <if test='neighborCircleAppDTO.topicId != null '> |
| | | and canc.topic_id = #{neighborCircleAppDTO.topicId} |
| | | </if> |
| | | <if test='neighborCircleAppDTO.keyWord != null and neighborCircleAppDTO.keyWord != ""'> |
| | | and (canct.`name` like concat (#{neighborCircleAppDTO.keyWord},'%') or |
| | | su.nick_name like concat (#{neighborCircleAppDTO.keyWord},'%') or |
| | | canc.release_content like concat (#{neighborCircleAppDTO.keyWord},'%')) |
| | | </if> |
| | | <if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 1'> |
| | | order by canc.hot_num desc |
| | | </if> |
| | | <if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 2'> |
| | | order by canc.create_at desc |
| | | </if> |
| | | <if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 3'> |
| | | order by canc.is_boutique asc |
| | | </if> |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | | update com_act_neighbor_circle set hot_num = hot_num + #{hotNum} where id = #{circleId} |
| | | </update> |
| | | |
| | | <update id="addTopicHotNum"> |
| | | update com_act_neighbor_circle_topic set hot_num = hot_num + 1 where id = (select topic_id from com_act_neighbor_circle where id = #{circleId}) |
| | | </update> |
| | | |
| | | <select id="pageNeighborByAdmin" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO"> |
| | | SELECT |
| | | nc.*, |
| | | u.`nick_name` AS releaseName,u.image_url,canct.`name` as topicName ,u.`type` as userType |
| | | ,u.name as communityName |
| | | FROM |
| | | com_act_neighbor_circle nc |
| | | LEFT JOIN sys_user u ON nc.release_id = u.user_id |
| | | LEFT JOIN com_act_neighbor_circle_topic as canct ON canct.id = nc.topic_id |
| | | <where> |
| | | nc.community_id = #{neighborCircleAdminDTO.communityId} |
| | | <if test='neighborCircleAdminDTO.releaseContent != null and neighborCircleAdminDTO.releaseContent != ""'> |
| | | and nc.release_content like concat('%',#{neighborCircleAdminDTO.releaseContent},'%') |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.topicName != null and neighborCircleAdminDTO.topicName != ""'> |
| | | and canct.`name` = #{neighborCircleAdminDTO.topicName} |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.keyWord != null and neighborCircleAdminDTO.keyWord != ""'> |
| | | and (canct.`name` like concat(#{neighborCircleAdminDTO.keyWord},'%') or |
| | | u.`nick_name` like concat(#{neighborCircleAdminDTO.keyWord},'%') or |
| | | nc.`release_content` like concat(#{neighborCircleAdminDTO.keyWord},'%') ) |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '> |
| | | and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt} |
| | | </if> |
| | | <if test='neighborCircleAdminDTO.status != null '> |
| | | and nc.status = #{neighborCircleAdminDTO.status} |
| | | </if> |
| | | </where> |
| | | order by |
| | | case when nc.`status`=1 then 0 else 1 end, |
| | | nc.`status` asc,nc.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="status" property="status" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="count" property="count" /> |
| | | <result column="hot_num" property="hotNum" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, community_id, name, status, create_at, create_by |
| | | id, community_id, name, status, create_at, create_by, count, hot_num |
| | | </sql> |
| | | |
| | | <select id="pageNeighborTopicByAdmin" parameterType="com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleTopicAdminDTO" |
| | |
| | | </select> |
| | | |
| | | <select id="getNeighborTopicByApp" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleTopicAppVO"> |
| | | select id,`name` from com_act_neighbor_circle_topic where `status` = 1 and community_id = #{communityId} |
| | | select id,`name`,hot_num,`count` from com_act_neighbor_circle_topic where `status` = 1 and community_id = #{communityId} |
| | | <if test="isZero != null and isZero == 1"> |
| | | and `count` > 0 |
| | | </if> |
| | | order by hot_num desc |
| | | </select> |
| | | |
| | | <update id="addHotNum"> |
| | | update com_act_neighbor_circle_topic set hot_num = hot_num + #{hotNum} where id = #{circleTopicId} |
| | | </update> |
| | | |
| | | <update id="addCount"> |
| | | update com_act_neighbor_circle_topic set `count` = `count` + 1 where id = #{circleTopicId} |
| | | </update> |
| | | </mapper> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getSysConfValue" resultType="string"> |
| | | SELECT `value` FROM `sys_conf` where `code` = #{key} |
| | | <if test="communityId != null"> and community_id = #{communityId} </if> |
| | | </select> |
| | | |
| | | </mapper> |