| | |
| | | import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO; |
| | | import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.entity.ComEvent; |
| | | import com.panzhihua.service_community.entity.ComMediateType; |
| | | import com.panzhihua.service_community.entity.ComSanshuoEvent; |
| | |
| | | @Resource |
| | | private IComEventService comEventService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @GetMapping ("/list") |
| | | public R list(@RequestParam(value = "keyWord",required = false)String keyWord, |
| | | @RequestParam(value = "page",required = false)Integer page, |
| | | @RequestParam(value = "size",required = false)Integer size){ |
| | | return commediateTypeService.listEvent(keyWord,page,size); |
| | | String appId=userService.detailUser(this.getUserId()).getData().getAppId(); |
| | | return commediateTypeService.listEvent(keyWord,page,size,appId); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | |
| | | /** |
| | | * 查询该事件类型的事件数量 |
| | | * */ |
| | | Integer selectEventCount(Long id); |
| | | Integer selectEventCount(@Param("id") Long id,@Param("appId")String appId); |
| | | } |
| | | |
| | | |
| | |
| | | * @param size |
| | | * @return 处理结果 |
| | | * */ |
| | | R listEvent(String keyWord, Integer page, Integer size); |
| | | R listEvent(String keyWord, Integer page, Integer size,String appId); |
| | | |
| | | /** |
| | | * 新增或修改事件类型 |
| | |
| | | * @return 处理结果 |
| | | * */ |
| | | @Override |
| | | public R listEvent(String keyWord, Integer page, Integer size) { |
| | | public R listEvent(String keyWord, Integer page, Integer size,String appId) { |
| | | IPage<ComMediateType> comMediateTypeIPage = comMediateTypeDao.eventList(new Page(page, size), keyWord); |
| | | List<ComMediateType> records = comMediateTypeIPage.getRecords(); |
| | | for (ComMediateType record : records) { |
| | | //查询事件数量 |
| | | if (nonNull(record) && nonNull(record.getId())){ |
| | | record.setEventCount(comMediateTypeDao.selectEventCount(record.getId())); |
| | | record.setEventCount(comMediateTypeDao.selectEventCount(record.getId(),appId)); |
| | | } |
| | | } |
| | | comMediateTypeIPage.setRecords(records); |
| | |
| | | <select id="dateAnalysis" resultType="com.panzhihua.common.model.vos.sanshuo.IndexDateVO"> |
| | | SELECT |
| | | (SELECT count(id) FROM com_sanshuo_event_info |
| | | where event_process_status in (2,3,5,6) |
| | | where event_process_status in (2,3,5,6) |
| | | AND user_event_status not in(3,4) |
| | | AND app_id='wx0cef797390444b75' |
| | | <if test="dto.type == 2"> |
| | |
| | | (SELECT count(id) FROM com_sanshuo_event_info |
| | | where is_end <> 1 |
| | | AND user_event_status not in(3,4) |
| | | AND event_process_status > 1 |
| | | AND event_process_status not in (9) |
| | | AND app_id='wx0cef797390444b75' |
| | | <if test="dto.type == 2"> |
| | | AND current_process_type in (1,5) |
| | |
| | | <select id="selectEventCount" resultType="java.lang.Integer"> |
| | | select count(id) from com_sanshuo_event_info |
| | | where event_category = #{id} |
| | | AND app_id=#{appId} |
| | | </select> |
| | | </mapper> |