Pu Zhibing
2024-10-16 c4664502dfdaffff555b532e65b51a57ac8b29c2
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
<?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.chargingPile.mapper.PartnerMapper">
    
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.chargingPile.api.model.Partner">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="`name`" property="name" />
        <result column="role_id" property="roleId" />
        <result column="logo_url" property="logoUrl" />
        <result column="rate" property="rate" />
        <result column="address" property="address" />
        <result column="phone_one" property="phoneOne" />
        <result column="phone_two" property="phoneTwo" />
        <result column="remark" property="remark" />
        <result column="account" property="account" />
        <result column="password" property="password" />
        <result column="permission_remarks" property="permissionRemarks"/>
        <result column="create_time" property="createTime" />
        <result column="del_flag" property="delFlag" />
    </resultMap>
    
    
    <select id="getPartnerList" resultType="com.ruoyi.chargingPile.api.dto.PartnerListDTO">
        select
        id,
        name,
        role_id as roleId,
        phone_one as phoneOne,
        address,
        account,
        remark
        from t_partner where del_flag = 0
        <if test="null != item.name and '' != item.name">
            and `name` like CONCAT('%', #{item.name}, '%')
        </if>
        <if test="null != item.roleId and '' != item.name">
            and role_id =  #{item.roleId}
        </if>
        order by create_time desc
    </select>
</mapper>