mitao
2025-03-19 0ab9dfd8f122195e4e9f09bd50c59e0a47450bec
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
59
60
61
62
<?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.system.mapper.StateTaskCenterMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.StateTaskCenter">
        <id column="id" property="id" />
        <result column="`name`" property="name" />
        <result column="module_name" property="moduleName" />
        <result column="remark" property="remark" />
        <result column="category" property="category" />
        <result column="flow_id" property="flowId" />
        <result column="variable" property="variable" />
        <result column="project_id" property="projectId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, `name`, module_name, remark,category,flow_id,variable,project_id,create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.ProcessTaskListVO">
        select stc.id, stc.`name`, stc.module_name, stc.remark,stc.category,stc.flow_id,stc.variable,
               tc.id AS contractId, tc.contract_number, tc.contract_name, tc.start_time, tc.end_time,tc.deposit, tc.pay_type,
               tc.first_pay_time, tc.isIncreasing,tc.isIncreasing_deposit,tc.proportion, tc.house_id, tc.party_one_name, tc.party_one_person,
               tc.party_one_phone, tc.tenant_id, tc.party_two_name,tc.party_two_person, tc.party_two_phone,tc.memory, tc.contract_file_name,
               tc.signature, tc.terminate_remark, tc.total_year,tc.status AS contractStatus,tc.create_time AS contractTime
        from state_task_center stc
        LEFT JOIN t_contract tc ON stc.project_id = tc.id
        <where>
            <if test="query.instanceIds != null and query.instanceIds.size()>0">
                AND stc.flow_id IN
                <foreach collection="query.instanceIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="query.name != null and query.name !=''">
                AND stc.`name` like concat('%',#{query.name},'%')
            </if>
            <if test="query.moduleName != null and query.moduleName !=''">
                AND stc.module_name like concat('%',#{query.moduleName},'%')
            </if>
            <if test="query.createBy != null and query.createBy !=''">
                AND stc.create_by like concat('%',#{query.createBy},'%')
            </if>
            <if test="query.partyTwoName != null and query.partyTwoName !=''">
                AND tc.party_two_name like concat('%',#{query.partyTwoName},'%')
            </if>
            <if test="query.contractNumber != null and query.contractNumber !=''">
                AND tc.contract_number like concat('%',#{query.contractNumber},'%')
            </if>
            <if test="query.contractName != null and query.contractName !=''">
                AND tc.contract_name like concat('%',#{query.contractName},'%')
            </if>
            <if test="query.status != null and query.status !=''">
                AND tc.status = #{query.status}
            </if>
            AND tc.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY stc.create_time DESC
    </select>
 
</mapper>