CustomerDevelopPlanMapper.xml
4.16 KB
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
<?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.lframework.xingyun.sc.mappers.CustomerDevelopPlanMapper">
    <resultMap id="CustomerDevelopPlan" type="com.lframework.xingyun.sc.entity.CustomerDevelopPlan">
        <id column="id" property="id"/>
        <result column="customer_id" property="customerId"/>
        <result column="workshop_id" property="workshopId"/>
        <result column="office_id" property="officeId"/>
        <result column="customer_type" property="customerType"/>
        <result column="product_variety_id" property="productVarietyId"/>
        <result column="monthly_usage" property="monthlyUsage"/>
        <result column="target_quantity" property="targetQuantity"/>
        <result column="industry" property="industry"/>
        <result column="mark" property="mark"/>
        <result column="thickness" property="thickness"/>
        <result column="width" property="width"/>
        <result column="material_require" property="materialRequire"/>
        <result column="quality_require" property="qualityRequire"/>
        <result column="peer" property="peer"/>
        <result column="pricing_mode" property="pricingMode"/>
        <result column="settle_days" property="settleDays"/>
        <result column="charge_user_id" property="chargeUserId"/>
        <result column="status" property="status"/>
        <result column="flow_instance_id" property="flowInstanceId"/>
        <result column="create_by_id" property="createById"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by_id" property="updateById"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>
    <sql id="CustomerDevelopPlan_sql">
        SELECT tb.id,
               tb.customer_id,
               tb.workshop_id,
               tb.office_id,
               tb.customer_type,
               tb.product_variety_id,
               tb.monthly_usage,
               tb.target_quantity,
               tb.industry,
               tb.mark,
               tb.thickness,
               tb.width,
               tb.material_require,
               tb.quality_require,
               tb.peer,
               tb.pricing_mode,
               tb.settle_days,
               tb.charge_user_id,
               tb.status,
               tb.flow_instance_id,
               tb.create_by_id,
               tb.create_by,
               tb.update_by_id,
               tb.update_by,
               tb.create_time,
               tb.update_time
        FROM customer_develop_plan AS tb
        INNER JOIN base_data_customer AS c ON tb.customer_id = c.id
    </sql>
    <select id="query" resultMap="CustomerDevelopPlan">
        <include refid="CustomerDevelopPlan_sql"/>
        <if test = "vo.workshopType != null and vo.workshopType != ''">
            LEFT JOIN base_data_workshop w ON tb.workshop_id = w.id
        </if>
        <where>
            <if test="vo.ids != null and vo.ids.size() > 0">
                AND tb.id in
                <foreach collection="vo.ids" open="(" separator="," close=")" item="id">
                    #{id}
                </foreach>
            </if>
            <if test="vo.customerId != null and vo.customerId != ''">
                AND tb.customer_id = #{vo.customerId}
            </if>
            <if test="vo.workshopId != null and vo.workshopId != ''">
                AND tb.workshop_id = #{vo.workshopId}
            </if>
            <if test="vo.officeId != null and vo.officeId != ''">
                AND tb.office_id = #{vo.officeId}
            </if>
            <if test="vo.status != null and vo.status != ''">
                AND tb.status = #{vo.status}
            </if>
            <if test = "vo.workshopType != null and vo.workshopType != ''">
                AND w.name in
                <foreach collection="vo.workshopNames" open="(" separator="," close=")" item="item">
                    #{item}
                </foreach>
            </if>
        </where>
    </select>
</mapper>