This commit is contained in:
2025-07-01 17:54:58 +08:00
commit 57dcd609e2
5136 changed files with 346184 additions and 0 deletions

View File

@@ -0,0 +1,277 @@
<?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.zhwl.report.mapper.ZdyCmsReportMapper">
<resultMap type="ZdyCmsReport" id="ZdyCmsReportResult">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="type" column="type"/>
<result property="content" column="content"/>
<result property="image" column="image"/>
<result property="linkperson" column="linkperson"/>
<result property="linktel" column="linktel"/>
<result property="ptContent" column="pt_content"/>
<result property="status" column="status"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="typeName" column="typeName"/>
<result property="userName" column="userName"/>
<result property="isUrgent" column="is_urgent"/>
<result property="scenicId" column="scenic_id"/>
<result property="scenicName" column="scenic_name"/>
<result property="updateBy" column="update_by"/>
<result property="deptId" column="dept_id"/>
</resultMap>
<sql id="selectZdyCmsReportVo">
SELECT re.id,
re.user_id,
re.type,
re.content,
re.image,
re.linkperson,
re.linktel,
re.pt_content,
re.STATUS,
re.create_time,
re.update_time,
re.is_urgent,
re.scenic_id,
re.update_by,
re.dept_id,
dict.dict_label AS typeName,
sc.scenic_name,
CASE
WHEN (ue.`name` IS NOT NULL AND ue.`name` != '') THEN
ue.`name`
ELSE ue.nickname
END AS userName
FROM zdy_cms_report re
LEFT JOIN sys_dict_data dict ON re.type = dict.dict_value
AND dict.dict_type = 'report_type'
LEFT JOIN zdy_user ue ON ue.id = re.user_id
LEFT JOIN zdy_scenic sc ON sc.id = re.scenic_id
</sql>
<select id="selectZdyCmsReportList" parameterType="ZdyCmsReport" resultMap="ZdyCmsReportResult">
<include refid="selectZdyCmsReportVo"/>
left join sys_dept d on d.dept_id = re.dept_id
<where>
<if test="userId != null ">
and re.user_id = #{userId}
</if>
<if test="type != null and type != ''">
and re.type = #{type}
</if>
<if test="content != null and content != ''">
and re.content = #{content}
</if>
<if test="image != null and image != ''">
and re.image = #{image}
</if>
<if test="linkperson != null and linkperson != ''">
and re.linkperson = #{linkperson}
</if>
<if test="linktel != null and linktel != ''">
and re.linktel = #{linktel}
</if>
<if test="ptContent != null and ptContent != ''">
and re.pt_content = #{ptContent}
</if>
<if test="status != null ">
and re.status = #{status}
</if>
<if test="scenicId != null ">
and re.scenic_id = #{scenicId}
</if>
${params.dataScope}
</where>
order by re.status asc, re.is_urgent desc, re.id desc
</select>
<select id="selectZdyCmsReportById" parameterType="Long"
resultMap="ZdyCmsReportResult">
<include refid="selectZdyCmsReportVo"/>
where re.id = #{id}
</select>
<insert id="insertZdyCmsReport" parameterType="ZdyCmsReport" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_cms_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,
</if>
<if test="type != null">type,
</if>
<if test="content != null">content,
</if>
<if test="image != null">image,
</if>
<if test="linkperson != null">linkperson,
</if>
<if test="linktel != null">linktel,
</if>
<if test="ptContent != null">pt_content,
</if>
<if test="status != null">status,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="isUrgent != null">is_urgent,
</if>
<if test="scenicId != null">scenic_id,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="deptId != null">dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},
</if>
<if test="type != null">#{type},
</if>
<if test="content != null">#{content},
</if>
<if test="image != null">#{image},
</if>
<if test="linkperson != null">#{linkperson},
</if>
<if test="linktel != null">#{linktel},
</if>
<if test="ptContent != null">#{ptContent},
</if>
<if test="status != null">#{status},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="isUrgent != null">#{isUrgent},
</if>
<if test="scenicId != null">#{scenicId},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="deptId != null">#{deptId},
</if>
</trim>
</insert>
<update id="updateZdyCmsReport" parameterType="ZdyCmsReport">
update zdy_cms_report
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id =
#{userId},
</if>
<if test="type != null">type =
#{type},
</if>
<if test="content != null">content =
#{content},
</if>
<if test="image != null">image =
#{image},
</if>
<if test="linkperson != null">linkperson =
#{linkperson},
</if>
<if test="linktel != null">linktel =
#{linktel},
</if>
<if test="ptContent != null">pt_content =
#{ptContent},
</if>
<if test="status != null">status =
#{status},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="isUrgent != null">is_urgent =
#{isUrgent},
</if>
<if test="scenicId != null">scenic_id =
#{scenicId},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyCmsReportById" parameterType="Long">
delete
from zdy_cms_report
where id = #{id}
</delete>
<delete id="deleteZdyCmsReportByIds" parameterType="String">
delete from zdy_cms_report where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectZdyCmsReportListApp" parameterType="ZdyCmsReport" resultMap="ZdyCmsReportResult">
<include refid="selectZdyCmsReportVo"/>
<where>
<if test="userId != null ">
and re.user_id = #{userId}
</if>
<if test="status != null ">
and re.status = #{status}
</if>
</where>
order by re.create_time desc
</select>
<select id="selectList" resultType="ReportGather">
SELECT
r.id,
r.linkperson,
r.linktel,
r.type,
zu.name as userName,
d.dict_label AS typeName,
r.scenic_id AS scenicId,
s.scenic_name AS scenicName,
r.status as status,
a.dict_label AS statusName,
r.create_time AS createTime,
r.update_time AS updateTime,
r.content,
r.image,
r.pt_content AS ptContent
FROM
zdy_cms_report r
LEFT JOIN zdy_scenic s ON r.scenic_id = s.id
LEFT JOIN sys_dict_data d ON d.dict_type = 'report_type'
AND r.type = d.dict_value
LEFT JOIN sys_dict_data a ON a.dict_type = 'report_status'
AND r.STATUS = a.dict_value
left join zdy_user zu on r.user_id=zu.id
<where>
<if test="startTime!=null and startTime!=''">
and r.create_time >= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and r.create_time &lt;= #{endTime}
</if>
</where>
ORDER BY
r.id DESC
</select>
</mapper>