xuhy
2023-10-19 78851285202a040f8ddf998c067cd462874c1cb9
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
<?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.OpenCityBusinessMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OpenCityBusiness">
        <id column="id" property="id"/>
        <result column="openCityId" property="openCityId"/>
        <result column="businessType" property="businessType"/>
        <result column="sort" property="sort"/>
 
        <result column="flag" property="flag"/>
        <result column="insertTime" property="insertTime"/>
        <result column="insertUser" property="insertUser"/>
        <result column="updateTime" property="updateTime"/>
        <result column="updateUser" property="updateUser"/>
    </resultMap>
 
 
 
    <select id="queryBusiness" resultType="OpenCityBusiness">
        select
        a.id as id,
        a.openCityId as openCityId,
        a.businessType as businessType,
        a.sort as sort,
        a.flag as flag,
        a.insertTime as insertTime,
        a.insertUser as insertUser,
        a.updateTime as updateTime,
        a.updateUser as updateUser
        from t_open_city_business a
        left join t_open_city b on (a.openCityId = b.id)
        where a.flag != 3 and b.flag != 3
        <if test="null != district">
            and b.provinceName = #{district}
        </if>
        <if test="null != city">
            and b.cityName = #{city}
        </if>
        <if test="null != province">
            and b.areaName = #{province}
        </if>
        order by a.sort
    </select>
 
 
    <select id="queryBusinessById" resultType="OpenCityBusiness">
        select
        id as id,
        openCityId as openCityId,
        businessType as businessType,
        sort as sort,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        from t_open_city_business
        where flag != 3 and openCityId = #{id} order by sort
    </select>
</mapper>