from erp_distribut_contract dc , erp_distribut_material dm , erp_purchase_material pm
where dc.id = dm.contract_id and dc.id = #{param.distributContractId } and dm.good_code = pm.good_code and pm.del_flag = 0 and dc.use_flag = '0'
where dc.id = dm.contract_id and dc.id = #{param.distributContractId } and dm.good_code = pm.good_code and pm.del_flag = '0' and dc.use_flag = '0' and dm.del_flag = '0' and dc.start_time > now() and dc.end_time < now()
<iftest="param.sparepartCode != null and param.sparepartCode !=''">and pm.sparepart_code =#{param.sparepartCode}</if>
<iftest="param.sparepartType != null and param.sparepartType !=''">and pm.sparepart_type in (${param.sparepartType}) </if>
<iftest="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%${param.sparepartName}%'</if>
...
...
@@ -70,7 +74,7 @@
</select>
<!-- 变更合同-->
<updateid="changePurchaseContract">
update erp_purchase_material set del_flag=1 where contract_id =#{contractId}
update erp_purchase_material set del_flag=#{delFlag} where contract_id =#{contractId}