From 86bba1b6323d5ae0340371ebfb0bc91271068c7e Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期二, 12 十一月 2024 15:37:07 +0800 Subject: [PATCH] 获取巡检员问题上报记录接口 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml | 82 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 82 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml index 8dedb69..e3609d8 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeIssueReportMapper.xml @@ -170,4 +170,86 @@ `state` = #{state,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} </update> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇宸℃鍛橀棶棰樹笂鎶ユ暟閲�--> + <select id="getIssueReportsCount" resultType="java.lang.Long"> + SELECT COUNT(*) AS recordCount + FROM ope_issue_report rpt + LEFT JOIN ba_user us ON us.id = rpt.inspector_id + LEFT JOIN ope_report_reply rpy ON rpy.report_id = rpt.id + <where> + AND rpt.state != 3 + + <if test="inspectorId != null"> + AND rpt.inspector_id = #{inspectorId} + </if> + + <if test="inspectorName != null and inspectorName != ''"> + AND us.name like CONCAT('%', #{inspectorName}, '%') + </if> + + <if test="content != null and content != ''"> + AND rpt.content like CONCAT('%', #{content}, '%') + </if> + + <if test="timeStart != null and timeStop != null "> + AND rpt.report_time BETWEEN #{timeStart} AND #{timeStop} + </if> + + <if test="state != null"> + AND rpt.state = #{state} + </if> + </where> + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇宸℃鍛橀棶棰樹笂鎶�--> + <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voOp.VoIssueReport"> + SELECT + rpt.id AS issueReportId, + us.name AS inspectorName, + rpt.phone, + rpt.report_time AS reportTime, + rpt.content, + rpt.images, + rpt.audios, + rpt.videos, + rpy.reply_time AS replyTime, + rpt.state AS stateId, + CASE + WHEN rpt.state = 1 THEN '鏈彈鐞�' + WHEN rpt.state = 2 THEN '宸插彈鐞�' + END AS state + FROM ope_issue_report rpt + LEFT JOIN ba_user us ON us.id = rpt.inspector_id + LEFT JOIN ope_report_reply rpy ON rpy.report_id = rpt.id + <where> + AND rpt.state != 3 + + <if test="inspectorId != null"> + AND rpt.inspector_id = #{inspectorId} + </if> + + <if test="inspectorName != null and inspectorName != ''"> + AND us.name like CONCAT('%', #{inspectorName}, '%') + </if> + + <if test="content != null and content != ''"> + AND rpt.content like CONCAT('%', #{content}, '%') + </if> + + <if test="timeStart != null and timeStop != null "> + AND rpt.report_time BETWEEN #{timeStart} AND #{timeStop} + </if> + + <if test="state != null"> + AND rpt.state = #{state} + </if> + </where> + ORDER BY rpt.report_time DESC + <trim prefix="limit "> + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0