<?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.miaxis.product.mapper.ProductTypeInfoMapper">

    <resultMap type="ProductTypeInfo" id="ProductTypeInfoResult">
        <result property="id"    column="id"    />
        <result property="productName"    column="product_name"    />
        <result property="pid"    column="pid"    />
        <result property="productDescribe"    column="product_describe"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="status"    column="status"    />
    </resultMap>

    <sql id="selectProductTypeInfoVo">
        select id, product_name, pid, product_describe, create_time, update_time, status from product_type_info
    </sql>

    <select id="selectProductTypeInfoList" parameterType="ProductTypeInfo" resultMap="ProductTypeInfoResult">
        <include refid="selectProductTypeInfoVo"/>
        <where>
            <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
            <if test="pid != null "> and pid = #{pid}</if>
            <if test="productDescribe != null  and productDescribe != ''"> and product_describe = #{describe}</if>
            <if test="status != null "> and status = #{status}</if>
        </where>
    </select>

</mapper>
