刘光辉
15 小时以前 34981c30a78e8bbd7791131059a9210f9928b62c
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?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="jnpf.limsMapper.LimsSxtQuyangdianMapper">
 
    <resultMap id="quyangdianVOMap" type="jnpf.limsModel.LimsSxtQuyangdianVO">
        <id property="id" column="f_id"/>
        <result property="tenantId" column="f_tenant_id"/>
        <result property="quyangdianBianhao" column="quyangdian_bianhao"/>
        <result property="quyangDidian" column="quyang_didian"/>
        <result property="chejianMingcheng" column="chejian_mingcheng"/>
        <result property="lururen" column="lururen"/>
        <result property="leiXing" column="leixing"/>
        <result property="luruShijian" column="luru_shijian"/>
        <result property="bizEnabled" column="biz_enabled"/>
        <result property="fuzeGangwei" column="fuze_gangwei"/>
        <result property="bizSign" column="biz_sign"/>
        <result property="chejianMingchengName" column="chejian_mingcheng_name"/>
 
        <!-- 关联字段 -->
        <result property="lururenName" column="lururen_name"/>
        <result property="leixingMingcheng" column="leixing_mingcheng"/>
        <result property="leixingType" column="leixing_type"/>
        <result property="fuzeGangweiName" column="fuze_gangwei_name"/>
        <result property="bizSignName" column="biz_sign_name"/>
    </resultMap>
 
    <resultMap id="quyangdianKuaizhaoMap" type="jnpf.limsModel.LimsSxtQuyangdianKuaizhaoModel">
        <id property="id" column="f_id"/>
        <result property="tenantId" column="f_tenant_id"/>
        <result property="quyangdianBianhao" column="quyangdian_bianhao"/>
        <result property="quyangDidian" column="quyang_didian"/>
        <result property="chejianMingcheng" column="chejian_mingcheng"/>
        <result property="chejianMingchengName" column="chejian_mingcheng_name"/>
        <result property="lururen" column="lururen"/>
        <result property="leiXing" column="leixing"/>
        <result property="luruShijian" column="luru_shijian"/>
        <result property="bizEnabled" column="biz_enabled"/>
        <result property="fuzeGangwei" column="fuze_gangwei"/>
        <result property="bizSign" column="biz_sign"/>
    </resultMap>
 
 
    <select id="selectByLeixingAndChejian" resultMap="quyangdianVOMap">
        SELECT
        t.quyangdian_bianhao,
        t.quyang_didian,
        t.chejian_mingcheng,
        t.lururen,
        t.leixing,
        t.luru_shijian,
        t.biz_enabled,
        t.fuze_gangwei,
        t.biz_sign,
        t.f_id,
        t.f_tenant_id,
        t.f_flow_id,
        t.f_flow_task_id,
        t.f_flow_state,
        t.f_version,
        t.f_delete_mark,
        t.f_delete_time,
        t.f_delete_user_id,
        t.chejian_mingcheng_name,
        u1.f_real_name AS lururen_name,
        y.mingcheng AS leixing_mingcheng,
        y.leixin AS leixing_type,
        r.f_full_name AS fuze_gangwei_name,
        u2.f_real_name AS biz_sign_name
        FROM
        lims_sxt_quyangdian t
        LEFT JOIN
        lims_sxt_chejian c ON t.chejian_mingcheng = c.f_id
        LEFT JOIN
        yangpin_guanli y ON t.leixing = y.f_id
        LEFT JOIN
        base_user u1 ON t.lururen = u1.f_id
        LEFT JOIN
        base_role r ON t.fuze_gangwei = r.f_id
        LEFT JOIN
        base_user u2 ON t.biz_sign = u2.f_id
        WHERE
        t.f_delete_mark IS NULL
        AND t.biz_enabled = 'enabled'
        AND t.leixing = #{leixing}
        AND t.chejian_mingcheng IN
        <foreach collection="chejianList" item="chejian" open="(" close=")" separator=",">
            #{chejian}
        </foreach>
        ORDER BY
        t.luru_shijian DESC
    </select>
 
    <select id="selectForTaskSnapshot" resultMap="quyangdianKuaizhaoMap">
        SELECT p.f_id,
               p.f_tenant_id,
               p.quyangdian_bianhao,
               p.quyang_didian,
               p.chejian_mingcheng,
               p.chejian_mingcheng_name,
               p.lururen,
               p.leixing,
               p.luru_shijian,
               p.biz_enabled,
               p.fuze_gangwei,
               p.biz_sign
        FROM lims_sxt_quyangdian p
        INNER JOIN lims_sxt_chejian c
                ON c.f_id = p.chejian_mingcheng
               AND c.f_tenant_id = #{tenantId}
               AND (c.f_delete_mark IS NULL OR c.f_delete_mark &lt;&gt; 1)
        WHERE p.f_tenant_id = #{tenantId}
          AND p.f_id = #{quyangdianId}
          AND p.biz_enabled = 'enabled'
          AND (p.f_delete_mark IS NULL OR p.f_delete_mark &lt;&gt; 1)
    </select>
 
</mapper>