|  |  | 
 |  |  |     SELECT COUNT(*) AS recordCount | 
 |  |  |     FROM se_issue_report rpt | 
 |  |  |         LEFT JOIN se_client cli ON cli.id = rpt.client_id | 
 |  |  |         LEFT JOIN se_report_reply rpy ON rpy.report_id = rpt.id | 
 |  |  |     <where> | 
 |  |  |       AND rpt.state != 3 | 
 |  |  |  | 
 |  |  | 
 |  |  |   </select> | 
 |  |  |  | 
 |  |  |   <!--根据指定条件获取农户问题上报--> | 
 |  |  |   <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voSe.VoIssueReport" > | 
 |  |  |   <select id="getIssueReports" resultType="com.dy.pipIrrGlobal.voSe.VoIssueReport_temp" > | 
 |  |  |     SELECT | 
 |  |  |         rpt.id AS issueReportId, | 
 |  |  |         cli.name AS clientName, | 
 |  |  | 
 |  |  |         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 se_issue_report rpt | 
 |  |  |         LEFT JOIN se_client cli ON cli.id = rpt.client_id | 
 |  |  |         LEFT JOIN se_report_reply rpy ON rpy.report_id = rpt.id | 
 |  |  |     <where> | 
 |  |  |       AND rpt.state != 3 | 
 |  |  |  | 
 |  |  | 
 |  |  |     </trim> | 
 |  |  |   </select> | 
 |  |  |  | 
 |  |  |   <!--根据上报ID及农户ID获取未删除的上报,删除上报判断使用--> | 
 |  |  |   <select id="getReport" resultType="com.dy.pipIrrGlobal.pojoSe.SeIssueReport"> | 
 |  |  |     SELECT * FROM se_issue_report WHERE state != 3 AND id = #{issueReportId} AND client_id = #{clientId} | 
 |  |  |   </select> | 
 |  |  |  | 
 |  |  |   <!--逻辑删除一个农户问题上报--> | 
 |  |  |   <update id="deleteIssueReport"> | 
 |  |  |     UPDATE se_issue_report SET state = 3 WHERE id = #{issueReportId} |