|
|
@ -413,7 +413,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
erp.use_num,erp.loss_rate, erp.parent_id, erp.`level`, erp.sort_no, erp.instance_id, |
|
|
|
erp.instance_type, processDict.dict_label as instance_type_name, erp.submit_instance_id, |
|
|
|
erp.cancel_instance_id, erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, |
|
|
|
file.url as photo_url,cate.name as material_type_name from erp_bom as erp |
|
|
|
cate.name as material_type_name from erp_bom as erp |
|
|
|
left join ( |
|
|
|
select id,material_no,material_name from erp_material |
|
|
|
) erp_material |
|
|
@ -427,29 +427,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
select code,name from sys_category |
|
|
|
where parent_id in( |
|
|
|
select id from sys_category |
|
|
|
where parent_id = (select id from sys_category where code = 'materialType') ) |
|
|
|
where parent_id = (select id from sys_category where code = 'materialType') |
|
|
|
) |
|
|
|
) cate |
|
|
|
on erp.material_type = cate.code |
|
|
|
left join ( |
|
|
|
select att.rel_id,file.url,min(file.create_time) as create_time from sys_attach as att |
|
|
|
left join sys_attach_file as file |
|
|
|
on att.id = file.attach_id |
|
|
|
where att.source_type = 'erpMaterial' and att.source_sub_type = 'photo' |
|
|
|
group by att.rel_id |
|
|
|
) file |
|
|
|
on erp_material.id = file.rel_id |
|
|
|
WHERE |
|
|
|
erp.material_no in #{params.materialNo} |
|
|
|
<if test="params.materialName != null and params.materialName != ''"> |
|
|
|
and erp.material_name in #{params.materialName} |
|
|
|
WHERE erp.del_flag = 0 and erp.audit_status = 1 |
|
|
|
<if test="parentIds != null and parentIds != ''"> |
|
|
|
and erp.id in (#{parentIds}) |
|
|
|
</if> |
|
|
|
<if test="params.bomNO != null and params.bomNo != ''"> |
|
|
|
and erp.bom_no in #{params.bomNo} |
|
|
|
<if test="materialNo != null and materialNo != ''"> |
|
|
|
and erp.material_no in (#{materialNo}) |
|
|
|
</if> |
|
|
|
<if test="bomNo != null and bomNo != ''"> |
|
|
|
and erp.bom_no = #{bomNo} |
|
|
|
</if> |
|
|
|
<if test="materialName != null and materialName != ''"> |
|
|
|
and erp.material_name in (#{materialName}) |
|
|
|
</if> |
|
|
|
AND erp.material_type IN |
|
|
|
<foreach item="type" index="index" collection="materialTypes" separator=","> |
|
|
|
#{type} |
|
|
|
</foreach> |
|
|
|
</select> |
|
|
|
<select id="selectErpBomByMaterialNos" parameterType="String" resultMap="ErpBomResult"> |
|
|
|
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, |
|
|
@ -517,6 +511,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
group by att.rel_id |
|
|
|
) file |
|
|
|
on erp_material.id = file.rel_id |
|
|
|
where erp.parent_id = #{parentId} |
|
|
|
where erp.parent_id in (#{parentId}) |
|
|
|
</select> |
|
|
|
</mapper> |