<?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.sqx.modules.fixedStroke.dao.FixedStrokeDao">


    <select id="selectFixedStrokeList" resultType="com.sqx.modules.fixedStroke.entity.FixedStroke">
        select * from fixed_stroke
        where 1=1
        <if test="shipProvince!=null and shipProvince!=''">
            and ship_province like concat('%',#{shipProvince},'%')
        </if>
        <if test="shipCity!=null and shipCity!=''">
            and ship_city like concat('%',#{shipCity},'%')
        </if>
        <if test="shipDistrict!=null and shipDistrict!=''">
            and ship_district like concat('%',#{shipDistrict},'%')
        </if>
        <if test="shipAddress!=null and shipAddress!=''">
            and ship_address like concat('%',#{shipAddress},'%')
        </if>
        <if test="deliveryProvince!=null and deliveryProvince!=''">
            and delivery_province like concat('%',#{deliveryProvince},'%')
        </if>
        <if test="deliveryCity!=null and deliveryCity!=''">
            and delivery_city like concat('%',#{deliveryCity},'%')
        </if>
        <if test="deliveryDistrict!=null and deliveryDistrict!=''">
            and delivery_district like concat('%',#{deliveryDistrict},'%')
        </if>
        <if test="deliveryAddress!=null and deliveryAddress!=''">
            and delivery_address like concat('%',#{deliveryAddress},'%')
        </if>
        <if test="status!=null">
            and status = #{status}
        </if>
        order by create_time desc
    </select>

    <select id="selectShipCityList" resultType="String">
        select ship_city from fixed_stroke where status=1 group by ship_city
    </select>

    <select id="selectDeliveryCityList" resultType="String">
        select delivery_city from fixed_stroke where status=1 group by delivery_city
    </select>

</mapper>