lidongdong
2023-11-14 ce4a770744d7a0b4e4ea3b5101556b94e72bdf1c
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbDynDAO.java
@@ -19,41 +19,28 @@
 **/
@Mapper
public interface ComPbDynDAO extends BaseMapper<ComPbDynDO> {
    // @Select("<script> " +
    // " <where>" +
    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
    // " </if> " +
    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
    // " </if> " +
    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
    // " </if> " +
    // " </where>" +
    // "</script>")
//     @Select("<script> " +
//     " <where>" +
//     "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//     " </if> " +
//     "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//     " </if> " +
//     "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
//     " </if> " +
//     " </where>" +
//     "</script>")
    @Select("<script> " + "SELECT\n" + "d.id,\n" + "d.title, d.jump_url, d.jump_type,\n" + "COUNT( u.id ) readingVolume,\n" + "d.`status`,\n"
        + "d.publish_at,\n" + "d.content,\n" + "d.cover,\n" + "d.cover_mode,\n" + "d.dyn_type,\n" + "d.create_at,t.name as communityName,d.policy_type \n"
        + "FROM\n" + "com_pb_dyn d\n" + "LEFT JOIN com_pb_dyn_user u ON d.id = u.dyn_id  left join com_act t on d.community_id = t.community_id\n"
        + "where d.type=#{partyBuildingComPbDynVO.type}  \n"
        + "<if test='partyBuildingComPbDynVO.communityIds != null and partyBuildingComPbDynVO.communityIds > 0 '>" + " and d.community_id in "
        + "<foreach item=\"item\" collection=\"partyBuildingComPbDynVO.communityIds\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n"
        + "#{item}\n" + "</foreach>\n" + " </if> "
        + "<if test='partyBuildingComPbDynVO.dynType != null and partyBuildingComPbDynVO.dynType != 0'>"
        + "and d.dyn_type = #{partyBuildingComPbDynVO.dynType} \n" + " </if> "
        + "<if test='partyBuildingComPbDynVO.policyType != null and partyBuildingComPbDynVO.policyType != 0'>"
        + "and d.policy_type = #{partyBuildingComPbDynVO.policyType} \n" + " </if> "
        + "<if test='partyBuildingComPbDynVO.policyType == 0'>"
        + "and d.policy_type is not null \n" + " </if> "
        + "<if test='partyBuildingComPbDynVO.title != null and partyBuildingComPbDynVO.title.trim() != &quot;&quot;'>"
        + "and d.title like concat(#{partyBuildingComPbDynVO.title},'%')  \n" + " </if> "
        + "<if test='partyBuildingComPbDynVO.status != null and partyBuildingComPbDynVO.status != 0'>"
        + "AND d.`status` = #{partyBuildingComPbDynVO.status} \n" + " </if> "
        + "<if test='partyBuildingComPbDynVO.publishAtBegin != null '>"
        + "AND d.publish_at BETWEEN #{partyBuildingComPbDynVO.publishAtBegin} \n"
        + "AND #{partyBuildingComPbDynVO.publishAtEnd} \n" + " </if> " + "GROUP BY\n" + "d.id\n"
        + "ORDER BY d.publish_at <if test='partyBuildingComPbDynVO.sort !=null and partyBuildingComPbDynVO.sort !=&quot;&quot;'> asc </if> <if test='partyBuildingComPbDynVO.sort ==null'> desc</if>" + "</script>")
    IPage<PartyBuildingComPbDynVO> pageYnamic(Page page,
        @Param("partyBuildingComPbDynVO") PartyBuildingComPbDynVO partyBuildingComPbDynVO);
    IPage<com.panzhihua.common.model.vos.partybuilding.PartyBuildingComPbDynVO> pageYnamics(Page page,
                         @Param("partyBuildingComPbDynVO") com.panzhihua.common.model.vos.partybuilding.PartyBuildingComPbDynVO partyBuildingComPbDynVO);
    @Update("update com_pb_dyn set `status`=2  WHERE `status`=1 and TIMESTAMPDIFF(MINUTE,SYSDATE(),publish_at)<=0")
    int timedTaskPartyBuildingStatus();