mobilebroken/nflg-mobilebroken-repository/src/main/resources/mapper/QuotationModelRatioAgentMap...

29 lines
1.3 KiB
XML

<?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.nflg.mobilebroken.repository.mapper.QuotationModelRatioAgentMapper">
<select id="search" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO">
SELECT pm.batch_number,pm.no
FROM v_quotation_model_price vqmp
LEFT JOIN product_model pm on vqmp.model_id=pm.batch_number and pm.state=1
LEFT JOIN product_type pt on pm.type_number=pt.batch_number AND pt.state=1
LEFT JOIN product_series ps ON pm.series_number=ps.batch_number AND ps.state=1
LEFT JOIN dictionary_item di ON di.id=pm.module_id
<where>
<if test="request.moduleId!=null">
AND pm.module_id=#{request.moduleId}
</if>
<if test="request.seriesNumber!=null">
AND pm.series_number=#{request.seriesNumber}
</if>
<if test="request.typeNumber!=null">
AND pm.type_number=#{request.typeNumber}
</if>
<if test="request.no!=null and request.no!=''">
AND pm.`no` like concat('%', #{request.no}, '%')
</if>
</where>
order by vqmp.id desc
</select>
</mapper>