<?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="org.dromara.zjk.mapper.ZjkProductSummarizeMapper">

    <select id="getProductInfo" resultType="org.dromara.zjk.domain.vo.ZjkProductSummarizeVo">
        SELECT  zp.product_name,zrp.review_time,zps.*
        from zjk_product_summarize zps
        INNER JOIN zjk_review_phase zrp on zrp.id = zps.review_id
        INNER JOIN zjk_product zp on zp.id = zrp.item_id
        where zps.del_flag = 0
        <if test="bo.search != null and bo.search!= '' ">
            and (zps.product_Summarize_Name like '%' || #{bo.search} ||'%' )
        </if>
          <if test="bo.productSummarizeType != null ">
            and zps.product_summarize_type = #{bo.productSummarizeType}
          </if>
          <if test="bo.status != null ">
            and zps.status = #{bo.status}
          </if>
        <if test="bo.startTime != null ">
            and zrp.review_time >= #{bo.startTime}
        </if>
        <if test="bo.endTime != null ">
            and zrp.review_time &lt;= #{bo.endTime}
        </if>
          <if test="bo.remark != null ">
            and (zps.remark like '%' ||  #{bo.remark} || '%')
        </if>
        <if test="bo.statusList != null and bo.statusList.size > 0 ">
            and  zps.status in
        <foreach collection="bo.statusList" open="(" separator="," close=")" item="status">
            #{status}
        </foreach>
        </if>
    </select>
    <select id="exportList" resultType="org.dromara.zjk.domain.vo.ZjkProductSummarizeVo">
        SELECT  zp.product_name,zrp.review_time,zps.*
        from zjk_product_summarize zps
        INNER JOIN zjk_review_phase zrp on zrp.id = zps.review_id
        INNER JOIN zjk_product zp on zp.id = zrp.item_id
        where zps.del_flag = 0
        <if test="bo.search != null and bo.search!= '' ">
            and (zps.product_Summarize_Name like '%' || #{bo.search} ||'%' )
        </if>
        <if test="bo.productSummarizeType != null ">
            and zps.product_summarize_type = #{bo.productSummarizeType}
        </if>
        <if test="bo.status != null ">
            and zps.status = #{bo.status}
        </if>
        <if test="bo.startTime != null ">
            and zrp.review_time >= #{bo.startTime}
        </if>
        <if test="bo.endTime != null ">
            and zrp.review_time &lt;= #{bo.endTime}
        </if>
        <if test="bo.remark != null ">
            and (zps.remark like '%' ||  #{bo.remark} || '%')
        </if>
        <if test="bo.statusList != null and bo.statusList.size > 0 ">
            and  zps.status in
            <foreach collection="bo.statusList" open="(" separator="," close=")" item="status">
                #{bo.status}
            </foreach>
        </if>
    </select>
</mapper>
