智慧保安后台管理-外网项目备份
zhongrj
2023-09-17 8853292babb2ad94de4a3207966f1e83b767cd2d
src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml
@@ -3,19 +3,51 @@
<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" resultMap="coinspectResultMap">
        select * from sys_coinspect where is_deleted = 0
    <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
        where 1 = 1
        <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>
    </select>
</mapper>