liujie
2023-08-31 d6811336d546e4963a9af3bd7cd8654d14193bce
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
<?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.stylefeng.guns.modular.system.dao.TYardMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TYard">
        <id column="id" property="id" />
        <result column="company_id" property="companyId" />
        <result column="location" property="location" />
        <result column="yard_name" property="yardName" />
        <result column="street_address" property="streetAddress" />
        <result column="city" property="city" />
        <result column="state" property="state" />
        <result column="zip_code" property="zipCode" />
        <result column="country" property="country" />
        <result column="contact_name" property="contactName" />
        <result column="contact_email" property="contactEmail" />
        <result column="gate_code" property="gateCode" />
        <result column="create_time" property="createTime" />
        <result column="remove" property="remove" />
    </resultMap>
    <select id="getList" resultType="com.stylefeng.guns.modular.system.model.TYardVo">
        select id,yard_name,street_address,city,state,zip_code,country,contact_email,contact_name from t_yard
        where remove=0 and company_id  =#{companyId}
        <if test="name!=null and name !=''">
            and (id like concat("%",#{name},"%") or yard_name like concat("%",#{name},"%"))
        </if>
        <if test="city!=null and city !=''">
            and (country like concat("%",#{city},"%") or state like concat("%",#{city},"%") or city like concat("%",#{city},"%") or zip_code like concat("%",#{city},"%"))
        </if>
        order by create_time desc
    </select>
 
</mapper>