<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.panzhihua.service_grid.dao.ComActEasyPhotoMapper">
|
|
<resultMap id="baseResult" type="com.panzhihua.service_grid.model.dos.ComActEasyPhotoDO">
|
<result property="id" column="id"/>
|
<result property="sponsorId" column="sponsor_id"/>
|
<result property="happenAddr" column="happen_addr"/>
|
<result property="addrRemark" column="addr_remark"/>
|
<result property="status" column="status"/>
|
<result property="handlerId" column="handler_id"/>
|
<result property="createAt" column="create_at"/>
|
<result property="examineAt" column="examine_at"/>
|
<result property="detail" column="detail"/>
|
<result property="photoPathList" column="photo_path_list"/>
|
<result property="handleResult" column="handle_result"/>
|
<result property="handlePhotoList" column="handle_photo_list"/>
|
<result property="communityId" column="community_id"/>
|
<result property="isHide" column="is_hide"/>
|
<result property="isNeedFeedBack" column="is_need_feed_back"/>
|
<result property="feedbackAt" column="feedback_at"/>
|
<result property="rejectReason" column="reject_reason"/>
|
<result property="delTag" column="del_tag"/>
|
<result property="isReport" column="is_report"/>
|
<result property="isPublicity" column="is_publicity"/>
|
<result property="handleStatus" column="handle_status"/>
|
</resultMap>
|
|
<sql id="columns">
|
<![CDATA[
|
id,sponsor_id,happen_addr,addr_remark,status,handler_id,create_at,examine_at,detail,photo_path_list,handle_result,handle_photo_list,community_id,is_hide,is_need_feed_back,feedback_at,reject_reason,del_tag,is_report,is_publicity
|
]]>
|
</sql>
|
|
|
<select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.ComActEasyPhotoVO"
|
parameterType="com.panzhihua.common.model.dtos.grid.PageEasyAppDTO">
|
SELECT
|
caep.id,
|
su.nick_name,
|
su.image_url,
|
caep.sponsor_id,
|
caep.detail,
|
caep.create_at,
|
caep.`status`,
|
caep.is_publicity,
|
caep.photo_path_list,
|
caep.happen_addr,
|
caep.addr_remark,
|
caep.handle_status,
|
caep.is_report
|
FROM
|
com_act_easy_photo AS caep
|
LEFT JOIN sys_user AS su ON su.user_id = caep.sponsor_id
|
<where>
|
AND caep.del_tag = 0
|
<if test="easyAppDTO.communityId!=null">
|
AND caep.community_id = ${easyAppDTO.communityId}
|
</if>
|
<if test="easyAppDTO.isReport!=null">
|
AND caep.is_report = #{easyAppDTO.isReport}
|
</if>
|
<if test="easyAppDTO.isPublicity!=null">
|
AND caep.is_publicity = #{easyAppDTO.isPublicity}
|
</if>
|
<if test="easyAppDTO.handleStatus!=null">
|
AND caep.handle_status = #{easyAppDTO.handleStatus}
|
</if>
|
</where>
|
ORDER BY caep.create_at desc
|
</select>
|
|
<select id="findByEaseId" resultType="com.panzhihua.common.model.vos.grid.ComActEasyPhotoVO">
|
SELECT
|
caep.id,
|
su.nick_name,
|
su.image_url,
|
caep.sponsor_id,
|
caep.detail,
|
caep.create_at,
|
caep.`status`,
|
caep.is_publicity,
|
caep.photo_path_list,
|
caep.happen_addr,
|
caep.addr_remark,
|
caep.handle_status,
|
caep.handle_result,
|
caep.handle_photo_list,
|
caep.feedback_at,
|
caep.lng_lat,
|
caep.handler_id,
|
su1.`name` AS handlerName,
|
caep.is_report
|
FROM
|
com_act_easy_photo AS caep
|
LEFT JOIN sys_user AS su ON su.user_id = caep.sponsor_id
|
LEFT JOIN sys_user AS su1 ON su1.user_id = caep.handler_id
|
<where>
|
<if test="easyId!=null">
|
AND caep.id = #{easyId}
|
</if>
|
</where>
|
ORDER BY caep.create_at desc
|
</select>
|
|
<select id="easyListByAdmin" parameterType="com.panzhihua.common.model.dtos.grid.PageEasyAdminDTO"
|
resultType="com.panzhihua.common.model.vos.grid.ComActEasyPhotoAdminVO">
|
SELECT
|
caep.id,
|
caep.detail,
|
su.nick_name as userNickName,
|
caep.create_at,
|
caep.is_report,
|
caep.is_publicity,
|
caep.classify_id,
|
caep.handle_status
|
FROM
|
com_act_easy_photo AS caep
|
LEFT JOIN sys_user AS su ON su.user_id = caep.sponsor_id
|
LEFT JOIN com_act_easy_photo_classify AS caepc ON caepc.id = caep.classify_id
|
LEFT JOIN sys_user AS su1 ON su1.user_id = caep.handler_id
|
LEFT JOIN com_act AS ca ON ca.community_id = caep.community_id
|
<where>
|
AND caep.del_tag = 0
|
<if test="easyAppDTO.communityId!=null">
|
AND caep.community_id = ${easyAppDTO.communityId}
|
</if>
|
<if test="easyAppDTO.streetId!=null">
|
and ca.street_id = #{easyAppDTO.streetId}
|
</if>
|
<if test="easyAppDTO.isReport!=null">
|
AND caep.is_report = #{easyAppDTO.isReport}
|
</if>
|
<if test="easyAppDTO.isPublicity!=null">
|
AND caep.is_publicity = #{easyAppDTO.isPublicity}
|
</if>
|
<if test="easyAppDTO.handleStatus!=null">
|
AND caep.handle_status = #{easyAppDTO.handleStatus}
|
</if>
|
<if test="easyAppDTO.easyPhotoTypeId!=null">
|
AND caep.classify_id = #{easyAppDTO.easyPhotoTypeId}
|
</if>
|
<if test="easyAppDTO.keyWord != null and easyAppDTO.keyWord != """>
|
AND (caepc.`name` LIKE concat (#{easyAppDTO.keyWord},'%') or
|
caep.detail LIKE concat (#{easyAppDTO.keyWord},'%') or
|
su.nick_name LIKE concat (#{easyAppDTO.keyWord},'%') or
|
caep.happen_addr LIKE concat (#{easyAppDTO.keyWord},'%') or
|
(caep.is_report = 0 and su1.nick_name LIKE concat (#{easyAppDTO.keyWord},'%')))
|
</if>
|
</where>
|
ORDER BY
|
caep.create_at DESC
|
</select>
|
|
<select id="easyDetailByAdmin" resultType="com.panzhihua.common.model.vos.grid.ComActEasyPhotoAdminVO">
|
SELECT DISTINCT
|
caep.id,
|
caep.detail,
|
su.nick_name AS userNickName,
|
su.image_url AS imageUrl,
|
caep.create_at,
|
caep.is_report,
|
caep.is_publicity,
|
caep.handle_status,
|
caep.detail,
|
caep.photo_path_list,
|
caep.addr_remark,
|
caep.happen_addr,
|
caep.lng_lat,
|
caep.handle_result,
|
caep.handle_photo_list,
|
su1.nick_name as handlerName,
|
caep.feedback_at as feedbackAt
|
FROM
|
com_act_easy_photo AS caep
|
LEFT JOIN sys_user AS su ON su.user_id = caep.sponsor_id
|
LEFT JOIN sys_user AS su1 ON su1.user_id = caep.handler_id
|
<where>
|
<if test="easyId!=null">
|
AND caep.id = #{easyId}
|
</if>
|
</where>
|
</select>
|
|
<update id="easyPublicityByAdmin" parameterType="com.panzhihua.common.model.dtos.grid.ComActEasyPhotoEditAdminDTO">
|
update com_act_easy_photo
|
<if test="photoEditDTO.type!=null and photoEditDTO.type == 1">
|
set is_publicity = #{photoEditDTO.isPublicity}
|
</if>
|
<if test="photoEditDTO.type!=null and photoEditDTO.type == 2">
|
set del_tag = 1
|
</if>
|
<if test="photoEditDTO.ids!=null and photoEditDTO.ids.size > 0">
|
where id in
|
<foreach collection='photoEditDTO.ids' item='id' index='index' open='(' close=')' separator=',' >
|
#{id}
|
</foreach>
|
</if>
|
</update>
|
</mapper>
|