lisy
2023-08-02 d69f9a06fb73f9d5efea882a684d217f12e34a4f
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
<?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.dsh.course.mapper.StoreMapper">
 
 
    <select id="queryProvince" resultType="map">
        select * from (
        select provinceCode as code, province as name from t_store where state = 1
         <if test="null != cityCode and '' != cityCode">
             and cityCode = #{cityCode}
         </if>
         group by provinceCode
        ) as aa order by aa.code
    </select>
 
 
    <select id="queryCity" resultType="map">
        select * from (
        select cityCode as code, city as name from t_store where state = 1 and provinceCode = #{provinceCode}
        <if test="null != cityCode and '' != cityCode">
            and cityCode = #{cityCode}
        </if>
        group by cityCode
        ) as aa order by aa.code
    </select>
</mapper>