<?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.bonus.canteen.core.supply.mapper.DrpSupplierApproveMapper">

    <select id="page" resultType="com.bonus.canteen.core.supply.vo.DrpSupplierApprovePageVO">
        select dsa.*,ds.supplier_name
        from drp_supplier_approve dsa
        left join  drp_supplier ds on dsa.supplier_id = ds.supplier_id
        <where>
            <if test="content.supplierId != null ">
                and dsa.supplier_id = #{content.supplierId}
            </if>
            <if test="content.startTime != null ">
                and  dsa.crtime >= #{content.startTime}
            </if>
            <if test="content.endTime != null ">
                and  dsa.crtime <![CDATA[ <= ]]> #{content.endTime}
            </if>
            <if test="content.approveStatus != null ">
                and  dsa.approve_status = #{content.approveStatus}
            </if>
        </where>
        order by dsa.crtime desc
    </select>
</mapper>
