<iftest="eceiptStatus != null and eceiptStatus != ''"> and eceipt_status = #{eceiptStatus}</if>
, b.dept_leader_confirm_status
<iftest="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
from sys_makeorder a
<iftest="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
left join(
<iftest="makeNo != null and makeNo != ''"> and makeNo = #{makeNo}</if>
select makeNo,dept_leader_confirm_status
<iftest="saleNo != null and saleNo != ''"> and saleNo = #{saleNo}</if>
from sys_makeorder_dept
<iftest="Salesman != null and Salesman != ''"> and Salesman = #{Salesman}</if>
where dept_number = #{deptNumber}
<iftest="customerId != null and customerId != ''"> and customerId = #{customerId}</if>
group by makeNo
<iftest="customerName != null and customerName != ''"> and customerName like concat('%', #{customerName}, '%')</if>
)b
<iftest="customerOderCode != null and customerOderCode != ''"> and customerOderCode = #{customerOderCode}</if>
on a.makeNo = b.makeNo
<iftest="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<where>
<iftest="makeStatus != null and makeStatus != ''"> and a.make_status = #{makeStatus}</if>
<iftest="eceiptStatus != null and eceiptStatus != ''"> and a.eceipt_status = #{eceiptStatus}</if>
<iftest="qualityStatus != null and qualityStatus != ''"> and a.quality_status = #{qualityStatus}</if>
<iftest="useStatus != null and useStatus != ''"> and a.use_status = #{useStatus}</if>
<iftest="makeNo != null and makeNo != ''"> and a.makeNo = #{makeNo}</if>
<iftest="saleNo != null and saleNo != ''"> and a.saleNo = #{saleNo}</if>
<iftest="Salesman != null and Salesman != ''"> and a.Salesman = #{Salesman}</if>
<iftest="customerId != null and customerId != ''"> and a.customerId = #{customerId}</if>
<iftest="customerName != null and customerName != ''"> and a.customerName like concat('%', #{customerName}, '%')</if>
<iftest="customerOderCode != null and customerOderCode != ''"> and a.customerOderCode = #{customerOderCode}</if>
<iftest="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and a.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>