sunshine
2024-11-05 00b4581009af28098da4286a8ef9f4d72c7c5728
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
<?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.nova.sankuai.infra.mapper.ApiCompanyMapper">
 
    <select id="pageModel" resultType="com.nova.sankuai.domain.vo.ApiCompanyVo">
        select
        ac.id as id,
        ac.enable_flag as enableFlag,
        ac.delivery_city as deliveryCity,
        ac.delivery_city_name as deliveryCityName,
        ac.customer_num as customerNum,
        ac.company_name as companyName,
        ac.creation_date as creationDate,
        ac.min_loan_amount as minLoanAmount,
        count(acr.id) as customerSum,
        ac.age_lower_limit as ageLowerLimit,
        ac.age_upper_limit as ageUpperLimit,
        ac.marriage_limit as marriageLimit,
        ac.sesame_limit as sesameLimit,
        ac.social_security_limit as socialSecurityLimit,
        ac.provident_fund_limit as providentFundLimit,
        ac.house_limit as houseLimit,
        ac.car_limit as carLimit,
        ac.policy_limit as policyLimit,
        ac.credit_card_limit as creditCardLimit,
        ac.amount_lower_limit as amountLowerLimit,
        ac.amount_upper_limit as amountUpperLimit,
        ac.monthly_income_limit as monthlyIncomeLimit,
        ac.education_limit as educationLimit,
        ac.channel_config as channelConfig
        from api_company ac
        left join api_company_record acr on ac.id = acr.company_id and acr.status =1
        <where>
            delete_flag = 0 and is_show_backstage = 1
            <if test="pageDto.id != null">
                and id = #{pageDto.id}
            </if>
            <if test="pageDto.companyName != null and pageDto.companyName !=''">
                and company_name like concat('%',#{pageDto.companyName},'%')
            </if>
        </where>
        group by ac.id
    </select>
 
    <select id="getCompanies" resultType="com.nova.sankuai.domain.entity.ApiCompany">
        select * from api_company
        <where>
            delete_flag = 0 and enable_flag = 1
            and (
            delivery_city like concat('%',#{cityId},'%')
            or delivery_city = #{provinceId}
            or delivery_city like concat('%,',#{provinceId},',%')
            or delivery_city like concat('%,',#{provinceId})
            or delivery_city like concat('%',#{provinceId},',%')
            )
        </where>
    </select>
 
    <select id="getApiCompany" resultType="com.nova.sankuai.domain.vo.ApiCompanyVo">
        select * from api_company
        <where>
            delete_flag = 0 and enable_flag = 1
        </where>
    </select>
 
    <select id="getSelectIncomeConfigs" resultType="com.nova.sankuai.domain.vo.IncomeConfigItemVo">
        select
        id as configRecordId,
        company_name as configRecordName,
        company_code as configRecordCode,
        '1' as type
        from api_company
        where delete_flag = 0
    </select>
 
</mapper>