xin
2025-06-04 9931d6f56816aecb09333cef2d12777c08793547
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
<?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.oying.modules.system.mapper.MerchantMapper">
    <resultMap id="BaseResultMap" type="com.oying.modules.system.domain.Merchant">
        <id column="merchant_id" property="merchantId"/>
        <result column="merchant_name" property="merchantName"/>
        <result column="merchant_code" property="merchantCode"/>
        <result column="business_license" property="businessLicense"/>
        <result column="business_license_path" property="businessLicensePath"/>
        <result column="contact_mobile" property="contactMobile"/>
        <result column="merchant_sort" property="merchantSort"/>
        <result column="enabled" property="enabled"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by" property="updateBy"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="audit_user" property="auditUser"/>
        <result column="audit_time" property="auditTime"/>
        <result column="audit_message" property="auditMessage"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        merchant_id, merchant_name, merchant_code, business_license, business_license_path, contact_mobile, merchant_sort, enabled, create_by, update_by, create_time, update_time, audit_user, audit_time, audit_message
    </sql>
 
    <select id="findAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sys_merchant
        <where>
            <if test="criteria.blurry != null and criteria.blurry != ''">
                and (
                merchant_name like concat('%', #{criteria.blurry}, '%')
                or merchant_code like concat('%', #{criteria.blurry}, '%')
                or business_license like concat('%', #{criteria.blurry}, '%')
                or contact_mobile like concat('%', #{criteria.blurry}, '%')
                )
            </if>
            <if test="criteria.enabled != null">
                and enabled = #{criteria.enabled}
            </if>
            <if test="criteria.createTime != null and criteria.createTime.size() > 0">
                AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
            </if>
        </where>
        order by merchant_sort desc
    </select>
</mapper>