<?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.fjhx.purchase.mapper.sales.SalesReturnMapper">
    <select id="getPage" resultType="com.fjhx.purchase.entity.sales.vo.SalesReturnVo">
        select
            sr.id,
            sr.code,
            sr.supply_id,
            sr.status,
            sr.create_user,
            sr.create_time,
            sr.update_user,
            sr.update_time
        from sales_return sr
            ${ew.customSqlSegment}
    </select>
    <select id="getListBySupplyId" resultType="com.fjhx.purchase.entity.sales.po.SalesReturn">
        SELECT sr.id,
               sr.CODE,
               sr.supply_id,
               srd.STATUS,
               sr.approved_date,
               sr.create_user,
               sr.create_time,
               sr.update_user,
               sr.update_time
        FROM sales_return sr
                 JOIN sales_return_detail srd ON srd.sales_return_id = sr.id
        where sr.supply_id = #{supply_id}
    </select>

</mapper>
