<?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.ktg.iscs.mapper.IsMaterialsPropertyValueMapper">

    <select id="getIsMaterialsPropertyValuePage" resultType="com.ktg.iscs.domain.IsMaterialsPropertyValue">
        select v.*, p.property_name from is_materials_property_value v
        left join is_materials_property p on v.property_id = p.property_id
        <where>
            <if test="isMaterialsPropertyValue.valueName != null and isMaterialsPropertyValue.valueName.trim != ''">
                and v.value_name like concat('%',#{isMaterialsPropertyValue.valueName},'%')
            </if>
            <if test="isMaterialsPropertyValue.propertyId != null">
                and v.property_id = #{isMaterialsPropertyValue.propertyId}
            </if>
        </where>
        order by v.record_id desc
    </select>
</mapper>
