| | |
| | | </if> |
| | | ORDER BY d.is_topping DESC, d.create_at DESC |
| | | </select> |
| | | |
| | | <!-- <select id="pageDynamicByAdmin" resultType="com.panzhihua.common.model.vos.community.ComActDynVO">--> |
| | | <!-- SELECT d.id, d.title,(SELECT COUNT(u.id) FROM com_act_dyn_user u WHERE d.id = u.dyn_id ) readNum,--> |
| | | <!-- d.`status`, d.`content`, d.`cover`, d.`type`, d.`cover_mode`,--> |
| | | <!-- d.is_topping, d.publish_at, d.create_at, cadt.`name` as typeName, ca.name as communityName,d.release_time--> |
| | | <!-- FROM com_act_dyn d--> |
| | | <!-- LEFT JOIN com_act_dyn_type as cadt ON cadt.id = d.type--> |
| | | <!-- LEFT JOIN com_act ca ON d.community_id = ca.community_id--> |
| | | <!-- WHERE 1=1--> |
| | | <!-- <if test="comActDynVO.communityId != null and comActDynVO.communityId != '' ">--> |
| | | <!-- and d.community_id in (${comActDynVO.communityId})--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- <if test="comActDynVO.communityId == null and comActDynVO.streetId != null" >--> |
| | | <!-- and d.community_id in (select community_id from com_act where street_id=#{comActDynVO.streetId})--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- <if test="comActDynVO.category != null and comActDynVO.category != '' ">--> |
| | | <!-- AND d.category = #{comActDynVO.category}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="comActDynVO.title != null and comActDynVO.title.trim() != '' ">--> |
| | | <!-- AND d.title like concat(#{comActDynVO.title},'%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="comActDynVO.isTopping != null and comActDynVO.isTopping != '' ">--> |
| | | <!-- AND d.is_topping = #{comActDynVO.isTopping}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="comActDynVO.status != null and comActDynVO.status != '' ">--> |
| | | <!-- AND d.`status` = #{comActDynVO.status}--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- <if test="comActDynVO.typeS == null or comActDynVO.typeS != 2 ">--> |
| | | <!-- <if test="comActDynVO.type != null and comActDynVO.type != '' ">--> |
| | | <!-- AND d.type = #{comActDynVO.type}--> |
| | | <!-- </if>--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- <if test="comActDynVO.typeS != null and comActDynVO.typeS == 2 ">--> |
| | | <!-- AND d.type in (--> |
| | | <!-- SELECT cadt.id FROM `com_act_dyn_type` as cadt WHERE cadt.name in--> |
| | | <!-- <foreach collection="comActDynVO.typeList" item="id" index="index" open="(" close=")" separator=",">--> |
| | | <!-- #{id}--> |
| | | <!-- </foreach>--> |
| | | <!-- <if test="comActDynVO.communityId != null and comActDynVO.communityId != '' ">--> |
| | | <!-- and cadt.community_id in (${comActDynVO.communityId})--> |
| | | <!-- </if>--> |
| | | <!-- union--> |
| | | <!-- SELECT cadt2.id FROM `com_act_dyn_type` as cadt2 WHERE cadt2.area=1 and cadt2.name in--> |
| | | <!-- <foreach collection="comActDynVO.typeList" item="id" index="index" open="(" close=")" separator=",">--> |
| | | <!-- #{id}--> |
| | | <!-- </foreach>--> |
| | | |
| | | <!-- )--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- <if test="comActDynVO.publishAtBegin != null and comActDynVO.publishAtBegin != '' ">--> |
| | | <!-- AND (d.publish_at BETWEEN #{comActDynVO.publishAtBegin} AND #{comActDynVO.publishAtEnd})--> |
| | | <!-- </if>--> |
| | | <!-- order by d.is_topping desc, d.create_at desc--> |
| | | <!-- </select>--> |
| | | |
| | | |
| | | <select id="pageDynamicByAdmin" resultType="com.panzhihua.common.model.vos.community.ComActDynVO"> |
| | | SELECT d.id, d.title,(SELECT COUNT(u.id) FROM com_act_dyn_user u WHERE d.id = u.dyn_id ) readNum, |
| | | d.`status`, d.`content`, d.`cover`, d.`type`, d.`cover_mode`, |
| | | SELECT d.id, d.title, |
| | | d.`status`, d.`cover`, d.`type`, d.`cover_mode`, |
| | | d.is_topping, d.publish_at, d.create_at, cadt.`name` as typeName, ca.name as communityName,d.release_time |
| | | FROM com_act_dyn d |
| | | LEFT JOIN com_act_dyn_type as cadt ON cadt.id = d.type |
| | |
| | | </if> |
| | | order by d.is_topping desc, d.create_at desc |
| | | </select> |
| | | |
| | | |
| | | <select id="getContent" resultType="String" parameterType="String"> |
| | | SELECT content FROM `com_act_dyn` WHERE id=#{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="getReadNum" resultType="Integer" parameterType="String"> |
| | | SELECT COUNT(id) FROM `com_act_dyn_user` WHERE dyn_id=#{dynId} |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |