package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.PageBaseDTO; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO; import com.panzhihua.common.model.vos.community.ComActMicroWishVO; import com.panzhihua.common.model.vos.community.StatisticsCommVO; import com.panzhihua.common.model.vos.community.TodoEventsVO; import com.panzhihua.common.model.vos.community.bigscreen.BigScreenMicroWishStatisticsInfo; import com.panzhihua.common.model.vos.community.screen.work.MicroListVO; import com.panzhihua.common.model.vos.user.SysUserVO; import com.panzhihua.service_community.model.dos.ComActMicroWishDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import java.util.List; import java.util.Map; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 微心愿 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-12-07 14:27 **/ @Mapper public interface ComActMicroWishDAO extends BaseMapper { @Select("") IPage pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); /** * 社区后台分页查询微心愿 * @param comActMicroWishVO 请求参数 * @return 微心愿列表 */ IPage pageMicroWishAdmin(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); IPage pageMicroWishApplets(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); // @Select("SELECT " + // "w.id, " + // "u.name sponsor_name, " + // "u.nick_name userNickName, " + // "w.create_at, " + // "w.aim_num, " + // "u.image_url, " + // "w.sponsor_phone, " + // "w.`status`, " + // "w.`sponsor_id`, " + // "w.wish_name, " + // "count(wu.id)starNum, " + // "w.detail, " + // "w.photo_path_list, " + // "su.`name` responsible_name, " + // "w.form, " + // "w.reject_reason, " + // "w.community_id, " + // "w.examine_at, " + // "w.finish, " + // "w.finish_photo_path_list, " + // "w.finish_at, " + // "w.score, " + // "w.feedback, " + // "w.feedback_at, " + // "w.feedback_photo_path_list, " + // "w.distribution_at, " + // "w.evaluate_at, " + // "w.img_width, " + // "w.img_height, " + // "w.handle_id, " + // "w.evaluate " + // "FROM " + // "com_act_micro_wish w " + // "LEFT JOIN sys_user u ON w.sponsor_id = u.user_id " + // "LEFT JOIN com_pb_service_team su ON w.responsible_id = su.id " + // "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id " + // "WHERE " + // "w.id =#{id}"+ // " group by w.id " + // "order by w.create_at desc" // ) ComActMicroWishVO detailMicroWish(Long id); @Select("SELECT " + "'2' type " + "FROM " + "com_act_micro_wish w " + "WHERE " + "w.community_id = ${communityId} " + "AND w.`status` = 1 " + " " + "union all " + " " + "SELECT " + "'2' type " + "FROM " + " com_act_micro_wish w " + "WHERE " + " w.community_id = ${communityId} " + " AND w.`status` = 3 " + " AND w.form = 1 " + " AND w.responsible_id = #{userId} " + "GROUP BY " + " w.community_id ") List selectNeedToDo(@Param("communityId") Long communityId, @Param("userId") Long userId); @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, finish_at, SYSDATE())>=72") int updateStatusAutoConfirm(); @Select("select id from com_act_micro_wish where `status`=5 and TIMESTAMPDIFF(HOUR, finish_at, SYSDATE())>=72 ") List getWishAutoConfirmIds(); @Select("SELECT COUNT(id) AS completedNum," + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = ${communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = ${communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " + "FROM com_act_micro_wish WHERE community_id = ${communityId} AND status = 6 ") Map countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate") String nowDate); @Select("SELECT photo_path_list FROM com_act_micro_wish WHERE community_id = ${communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) ORDER BY create_at DESC limit #{pageSize}") List getAllImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize); @Select("") IPage getScreenMicroList(Page page, @Param("microListDTO") ScreenMicroListDTO microListDTO); /** * 微心愿处理人列表 * @param communityId 社区id * @param type 处理人类型(1.后台用户 2.党员 3.志愿者) * @return 处理人列表 */ List getWishHandleListAdmin(@Param("type") Integer type,@Param("communityId") Long communityId); SysUserVO getUserByUserId(@Param("userId") Long userId); /** * 待实现&已实现数目及占比 * @param communityId * @return */ List selectRealizePercent(@Param("communityId") Long communityId); /** * 获取通过的微心愿图片 * @param communityId * @param pageSize * @return */ List getPassedAllImages(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); /** * 首页二级页面-微心愿基础数据查询 * @param communityId * @return */ BigScreenMicroWishStatisticsInfo selectIndexMicroWishBaseData(@Param("communityId") Long communityId); List getMicroWishAddPolylineData(@Param("communityId") Long communityId); StatisticsCommVO getMicroWishTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date); /** * 微心愿大屏展示列表 * @param page * @param pageBaseDTO * @return */ IPage selectScreenDisplayList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); /** * 金沙定制页面-志愿线展示列表 * @param page * @param pageBaseDTO * @return */ IPage pagePartyBuildIngMicroWish(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); /** * 金沙定制页面-四长四员解决问题展示列表 * @param page * @param pageBaseDTO * @return */ IPage pageFourMemberResolve(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); }