<?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.fzm.mall.server.admin.distribution.mapper.ExpressMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.distribution.model.Express">
        <id column="id" property="id" />
        <result column="express_id" property="expressId" />
        <result column="img_url" property="imgUrl" />
        <result column="simple_name" property="simpleName" />
        <result column="phone" property="phone" />
        <result column="exp_name" property="expName" />
        <result column="url" property="url" />
        <result column="note" property="note" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <select id="listAll" resultMap="BaseResultMap">
        select id, express_id, img_url, simple_name, phone, exp_name, url, note, create_time, update_time
        from distribution_express
        <where>
            <if test="expName != null and expName != ''">
                and exp_name like CONCAT('%', #{expName},'%')
            </if>
        </where>
        order by create_time desc
    </select>
</mapper>
