| | |
| | | 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; |
| | | |
| | |
| | | "SELECT\n" + |
| | | "w.id,\n" + |
| | | "u.name sponsor_name,\n" + |
| | | "u.nick_name userNickName,\n" + |
| | | "u.image_url ,\n" + |
| | | "w.sponsor_phone,\n" + |
| | | "w.wish_name,\n" + |
| | |
| | | "<if test='comActMicroWishVO.sponsorPhone != null and comActMicroWishVO.sponsorPhone.trim() != ""'>" + |
| | | "AND w.sponsor_phone like concat(#{comActMicroWishVO.sponsorPhone},'%') \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.status!=3 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "AND w.`status` = #{comActMicroWishVO.status} \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status == 3 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "AND ( w.`status` = 3 or w.`status` = 5 )\n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" + |
| | | "AND w.`status` in (1,2) \n" + |
| | | "AND w.`status` =1 \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status==3 and comActMicroWishVO.isPageMyWish!=null '>" + |
| | | "AND w.`status` in (2, 3) \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.createBegin != null '>" + |
| | | "AND w.create_at BETWEEN #{comActMicroWishVO.createBegin} \n" + |
| | | "AND #{comActMicroWishVO.createEnd}" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'>" + |
| | | "AND w.status in (3,6) \n" + |
| | | "AND w.status in (3, 5, 6) \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'>" + |
| | | "AND w.sponsor_id =#{comActMicroWishVO.userId} \n" + |
| | |
| | | " </if> " + |
| | | " </where>" + |
| | | " group by w.id \n"+ |
| | | "ORDER BY w.`status` asc, w.create_at desc "+ |
| | | "ORDER BY w.create_at desc "+ |
| | | "</script>") |
| | | IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); |
| | | @Select("SELECT\n" + |
| | | "w.id,\n" + |
| | | "u.name sponsor_name,\n" + |
| | | "u.nick_name userNickName,\n" + |
| | | "w.create_at,\n" + |
| | | "u.image_url,\n" + |
| | | "w.sponsor_phone,\n" + |
| | | "w.`status`,\n" + |
| | | "w.`sponsor_id`,\n" + |
| | | "w.wish_name,\n" + |
| | | "count(wu.id)starNum,\n" + |
| | | "w.detail,\n" + |
| | |
| | | "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id \n" + |
| | | "WHERE\n" + |
| | | "w.id =#{id}"+ |
| | | " group by w.id " |
| | | " group by w.id " + |
| | | "order by w.create_at desc" |
| | | ) |
| | | ComActMicroWishVO detailMicroWish(Long id); |
| | | @Select("SELECT\n" + |
| | | "'微心愿' FUNCTION,\n" + |
| | | "'待审核' behavior,\n" + |
| | | "'新增微心愿动态待审核' words \n" + |
| | | "'2' type\n" + |
| | | "FROM\n" + |
| | | "com_act_micro_wish w \n" + |
| | | "WHERE\n" + |
| | |
| | | "union all \n" + |
| | | "\n" + |
| | | "SELECT\n" + |
| | | "\t'微心愿' FUNCTION,\n" + |
| | | "\t'需要进行反馈' behavior,\n" + |
| | | "\t'微心愿有待反馈动态' words \n" + |
| | | "'2' type\n" + |
| | | "FROM\n" + |
| | | "\tcom_act_micro_wish w \n" + |
| | | "WHERE\n" + |
| | |
| | | "GROUP BY\n" + |
| | | "\tw.community_id\n") |
| | | List<TodoEventsVO> 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, feedback_at, SYSDATE())>=72") |
| | | int updateStatusAutoConfirm(); |
| | | |
| | | } |