GoodsProviderMapper.xml 1.72 KB
<?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.bs.order.mapper.GoodsProviderMapper">

    <resultMap id="BaseResultMap" type="com.bs.order.entity.GoodsProvider">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="providerName" column="provider_name" jdbcType="VARCHAR"/>
            <result property="address" column="address" jdbcType="VARCHAR"/>
            <result property="contactName" column="contact_name" jdbcType="VARCHAR"/>
            <result property="contactPhone" column="contact_phone" jdbcType="VARCHAR"/>
            <result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
            <result property="createdDate" column="created_date" jdbcType="TIMESTAMP"/>
            <result property="updatedBy" column="updated_by" jdbcType="VARCHAR"/>
            <result property="updatedDate" column="updated_date" jdbcType="TIMESTAMP"/>
            <result property="deletedFlag" column="deleted_flag" jdbcType="CHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        id,provider_name,address,contact_name,contact_phone,created_by,
        created_date,updated_by,updated_date,deleted_flag
    </sql>

    <select id="list" resultMap="BaseResultMap">
        select id, provider_name,address,contact_name,contact_phone from bo_goods_provider
        <where>
            deleted_flag = 'N'
            <if test="query.providerName != null and query.providerName !=''">
                and provider_name like concat('%', #{query.providerName}, '%')
            </if>
        </where>
        order by updated_date desc
    </select>
</mapper>