b557fda9 康伟

kangwei: 补充丢失的查询方法

1 个父辈 dfc2c0c0
......@@ -2,6 +2,63 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.erp.mapper.MaterialINMapper">
<!--查询 入库单 -->
<select id="queryArrivalRecordByList" resultType="com.skua.modules.erp.vo.ArrivalRecordExcelExportVO">
select d.depart_name, pc.contract_code 'purchaseContractCode', dc.contract_code 'distributContractCode' ,ss.sparepart_name,mi.*
from erp_material_in mi
left join sys_depart d on d.id = mi.depart_id
left join erp_purchase_contract pc on pc.id = mi.purchase_contract_id
left join erp_distribut_contract dc on dc.id = mi.distribut_contract_id
left join equipment_sparepart_supplies ss on ss.id = mi.supplier_id
<where>
mi.audit_status =3
<if test="startTime != null and startTime !=''">
and mi.arrive_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and mi.arrive_time &lt;= #{endTime}
</if>
<if test="goodCode != null and goodCode !=''">
and mi.good_code like CONCAT('',#{goodCode},'%')
</if>
<if test="sparepartName != null and sparepartName !=''">
and mi.sparepart_name like CONCAT('%',#{sparepartName},'%')
</if>
<if test="departId != null and departId !=''">
and mi.depart_id = #{departId}
</if>
<if test="supplierId != null and supplierId !=''">
and mi.supplier_id = #{supplierId}
</if>
</where>
order by arrive_time desc
</select>
<!--获取入库审批列表:根据部门、采购合同、供应商、药剂分组搜索 -->
<select id="selectAuditMaterialINByPage" resultType="com.skua.modules.erp.vo.ArrivalRecordExcelExportVO">
select sparepart_id , purchase_contract_id,depart_id ,supplier_id,
sum(purchase_num) 'purchase_num',measuring_unit,specification,sparepart_name,tax_amount,
purchase_price,distribut_price,sum(purchase_total_price) 'purchase_total_price',sum(distribut_total_price) 'distribut_total_price',sum(total_price_tax) 'total_price_tax'
from erp_material_in
<where>
audit_status =3
<if test="materialIN.startTime != null and materialIN.startTime !=''">
and arrive_time &gt;= #{materialIN.startTime}
</if>
<if test="materialIN.endTime != null and materialIN.endTime !=''">
and arrive_time &lt;= #{materialIN.endTime}
</if>
<if test="materialIN.departId != null and materialIN.departId !=''">
and depart_id = #{materialIN.departId}
</if>
<if test="materialIN.supplierId != null and materialIN.supplierId !=''">
and supplier_id = #{materialIN.supplierId}
</if>
<if test="materialIN.purchaseContractId != null and materialIN.purchaseContractId !=''">
and purchase_contract_id = #{materialIN.purchaseContractId}
</if>
</where>
group by sparepart_id,purchase_contract_id,depart_id,supplier_id
</select>
<select id="queryById" resultType="com.skua.modules.erp.entity.MaterialIN">
select d.depart_name 'departName', st.item_text 'sparepartTypeName', sm.supp_name 'supplierName', t.* from erp_material_in t
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!