From b5960d1968e007b91d4d33dd7cbb74f1b566f2c1 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 24 May 2024 10:20:01 +0800
Subject: [PATCH] 到期时间修改

---
 src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml |  119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 113 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml b/src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml
index ee0b701..6fcbd75 100644
--- a/src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml
+++ b/src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml
@@ -3,19 +3,126 @@
 <mapper namespace="org.springblade.modules.coinspect.mapper.CoinspectMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="coinspectResultMap" type="org.springblade.modules.coinspect.entity.Coinspect">
+    <resultMap id="coinspectResultMap" type="org.springblade.modules.coinspect.vo.CoinspectVO">
         <id column="id" property="id"/>
-        <result column="name" property="name"/>
-        <result column="sName" property="sname"/>
-        <result column="deptName" property="deptname"/>
+        <result column="examiner_id" property="examinerId"/>
+        <result column="reviewed_dept_id" property="reviewedDeptId"/>
+        <result column="examiner_dept_id" property="examinerDeptId"/>
         <result column="reviewTime" property="reviewtime"/>
         <result column="insid" property="insid"/>
         <result column="results" property="results"/>
+        <result column="url" property="url"/>
     </resultMap>
 
+    <!--自定义分页数据-->
+    <select id="selectCoinspectPage" resultType="org.springblade.modules.coinspect.vo.CoinspectVO">
+        select
+        sc.*,
+        bu.real_name realName,
+        bd.dept_name examinerDeptName,
+        bd1.dept_name reviewedDeptName
+        from
+        sys_coinspect sc
+        left join
+        blade_user bu
+        on
+        bu.id = sc.examiner_id
+        left join
+        blade_dept bd
+        on
+        bd.id = sc.examiner_dept_id
+        left join
+        blade_dept bd1
+        on
+        bd1.id = sc.reviewed_dept_id
+        left join
+        sys_information si
+        on
+        si.departmentid = bu.dept_id
+        left join
+        sys_jurisdiction sj
+        on
+        sj.id = si.jurisdiction
+        where 1 = 1
+        <if test="coinspect.jurisdiction!=null and coinspect.jurisdiction!='' and coinspect.jurisdiction!='1372091709474910209'">
+            and (sj.id = #{coinspect.jurisdiction} or sj.parent_id = #{coinspect.jurisdiction})
+        </if>
+        <if test="coinspect.realName!=null and coinspect.realName!=''">
+            and bu.real_name like concat('%',#{coinspect.realName},'%')
+        </if>
+        <if test="coinspect.examinerDeptName!=null and coinspect.examinerDeptName!=''">
+            and bd.dept_name like concat('%',#{coinspect.examinerDeptName},'%')
+        </if>
+        <if test="coinspect.reviewedDeptName!=null and coinspect.reviewedDeptName!=''">
+            and bd1.dept_name like concat('%',#{coinspect.reviewedDeptName},'%')
+        </if>
+        <if test="coinspect.results!=null and coinspect.results!=''">
+            and sc.results like concat('%',#{coinspect.results},'%')
+        </if>
+        <if test="coinspect.startTime!=null and coinspect.startTime!=''">
+            and sc.reviewTime &gt;= #{coinspect.startTime}
+        </if>
+        <if test="coinspect.endTime!=null and coinspect.endTime!=''">
+            and sc.reviewTime &lt;= #{coinspect.endTime}
+        </if>
+        <if test="coinspect.endTime!=null and coinspect.endTime!=''">
+            and sc.reviewTime &lt;= #{coinspect.endTime}
+        </if>
+    </select>
 
-    <select id="selectCoinspectPage" resultMap="coinspectResultMap">
-        select * from sys_coinspect where is_deleted = 0
+    <!--导出单位检查信息-->
+    <select id="exportCoinspect" resultType="org.springblade.modules.coinspect.excel.CoinspectExcel">
+        select
+        bu.real_name realName,
+        bd1.dept_name reviewedDeptName,
+        bd.dept_name examinerDeptName,
+        sc.reviewTime reviewtime,
+        sc.insid content,
+        sc.results result
+        from
+        sys_coinspect sc
+        left join
+        blade_user bu
+        on
+        bu.id = sc.examiner_id
+        left join
+        blade_dept bd
+        on
+        bd.id = sc.examiner_dept_id
+        left join
+        blade_dept bd1
+        on
+        bd1.id = sc.reviewed_dept_id
+        left join
+        sys_information si
+        on
+        si.departmentid = bu.dept_id
+        left join
+        sys_jurisdiction sj
+        on
+        sj.id = si.jurisdiction
+        where 1 = 1
+        <if test="coinspect.jurisdiction!=null and coinspect.jurisdiction!='' and coinspect.jurisdiction!='1372091709474910209'">
+            and (sj.id = #{coinspect.jurisdiction} or sj.parent_id = #{coinspect.jurisdiction})
+        </if>
+        <if test="coinspect.realName!=null and coinspect.realName!=''">
+            and bu.real_name like concat('%',#{coinspect.realName},'%')
+        </if>
+        <if test="coinspect.examinerDeptName!=null and coinspect.examinerDeptName!=''">
+            and bd.dept_name like concat('%',#{coinspect.examinerDeptName},'%')
+        </if>
+        <if test="coinspect.reviewedDeptName!=null and coinspect.reviewedDeptName!=''">
+            and bd1.dept_name like concat('%',#{coinspect.reviewedDeptName},'%')
+        </if>
+        <if test="coinspect.results!=null and coinspect.results!=''">
+            and sc.results like concat('%',#{coinspect.results},'%')
+        </if>
+        <if test="coinspect.startTime!=null and coinspect.startTime!=''">
+            and sc.reviewTime &gt;= #{coinspect.startTime}
+        </if>
+        <if test="coinspect.endTime!=null and coinspect.endTime!=''">
+            and sc.reviewTime &lt;= #{coinspect.endTime}
+        </if>
     </select>
 
 </mapper>

--
Gitblit v1.9.3