12 小时以前 3d556b8defe1ff5b9aeb481bd1d0a67b2ded0192
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?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.ruoyi.approve.mapper.ApprovalInstanceMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.approve.pojo.ApprovalInstance">
        <id column="id" property="id" />
        <result column="instance_no" property="instanceNo" />
        <result column="template_id" property="templateId" />
        <result column="template_name" property="templateName" />
        <result column="business_id" property="businessId" />
        <result column="business_type" property="businessType" />
        <result column="title" property="title" />
        <result column="status" property="status" />
        <result column="current_level" property="currentLevel" />
        <result column="applicant_id" property="applicantId" />
        <result column="applicant_name" property="applicantName" />
        <result column="apply_time" property="applyTime" />
        <result column="finish_time" property="finishTime" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
        <result column="update_user" property="updateUser" />
        <result column="update_time" property="updateTime" />
        <result column="deleted" property="deleted" />
    </resultMap>
    <select id="listPage" resultType="com.ruoyi.approve.bean.vo.ApprovalInstanceVo">
        select ai.*,su.nick_name as create_user_name from
        approval_instance ai
        left join sys_user su on ai.create_user = su.user_id
        <where>
            deleted = 0
            <if test="ew.instanceNo != null">
                and ai.instance_no like concat('%',#{ew.instanceNo},'%')
            </if>
            <if test="ew.templateName != null">
                and ai.template_name like concat('%',#{ew.templateName},'%')
            </if>
            <if test="ew.templateId != null ">
                and ai. template_id = #{ew.templateId}
            </if>
            <if test="ew.businessType != null ">
                and ai.business_type = #{ew.businessType}
            </if>
            <if test="ew.createTimeStart != null and ew.createTimeEnd != null">
                and ai.apply_time &gt;= #{ew.createTimeStart}
                and ai.apply_time &lt;= #{ew.createTimeEnd}
            </if>
            <if test="ew.status != null">
                and ai.status = #{ew.status}
            </if>
            <if test="ew.applicantName != null and ew.applicantName !=''">
                and ai.applicant_name = #{ew.applicantName}
            </if>
        </where>
        order by ai.create_time desc
    </select>
 
</mapper>