|
@ -413,43 +413,37 @@ 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.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.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, |
|
|
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 ( |
|
|
left join ( |
|
|
select id,material_no,material_name from erp_material |
|
|
select id,material_no,material_name from erp_material |
|
|
) erp_material |
|
|
) erp_material |
|
|
on erp.material_no = erp_material.material_no |
|
|
on erp.material_no = erp_material.material_no |
|
|
left join( |
|
|
left join( |
|
|
select dict_value,dict_label from sys_dict_data |
|
|
select dict_value,dict_label from sys_dict_data |
|
|
where dict_type = 'processType' |
|
|
where dict_type = 'processType' |
|
|
) processDict |
|
|
) processDict |
|
|
on erp.instance_type = processDict.dict_value |
|
|
on erp.instance_type = processDict.dict_value |
|
|
left join ( |
|
|
left join ( |
|
|
select code,name from sys_category |
|
|
select code,name from sys_category |
|
|
where parent_id in( |
|
|
where parent_id in( |
|
|
select id from sys_category |
|
|
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 |
|
|
) cate |
|
|
on erp.material_type = cate.code |
|
|
on erp.material_type = cate.code |
|
|
left join ( |
|
|
WHERE erp.del_flag = 0 and erp.audit_status = 1 |
|
|
select att.rel_id,file.url,min(file.create_time) as create_time from sys_attach as att |
|
|
<if test="parentIds != null and parentIds != ''"> |
|
|
left join sys_attach_file as file |
|
|
and erp.id in (#{parentIds}) |
|
|
on att.id = file.attach_id |
|
|
</if> |
|
|
where att.source_type = 'erpMaterial' and att.source_sub_type = 'photo' |
|
|
<if test="materialNo != null and materialNo != ''"> |
|
|
group by att.rel_id |
|
|
and erp.material_no in (#{materialNo}) |
|
|
) file |
|
|
</if> |
|
|
on erp_material.id = file.rel_id |
|
|
<if test="bomNo != null and bomNo != ''"> |
|
|
WHERE |
|
|
and erp.bom_no = #{bomNo} |
|
|
erp.material_no in #{params.materialNo} |
|
|
</if> |
|
|
<if test="params.materialName != null and params.materialName != ''"> |
|
|
<if test="materialName != null and materialName != ''"> |
|
|
and erp.material_name in #{params.materialName} |
|
|
and erp.material_name in (#{materialName}) |
|
|
</if> |
|
|
|
|
|
<if test="params.bomNO != null and params.bomNo != ''"> |
|
|
|
|
|
and erp.bom_no in #{params.bomNo} |
|
|
|
|
|
</if> |
|
|
</if> |
|
|
AND erp.material_type IN |
|
|
|
|
|
<foreach item="type" index="index" collection="materialTypes" separator=","> |
|
|
|
|
|
#{type} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</select> |
|
|
</select> |
|
|
<select id="selectErpBomByMaterialNos" parameterType="String" resultMap="ErpBomResult"> |
|
|
<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, |
|
|
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 |
|
|
group by att.rel_id |
|
|
) file |
|
|
) file |
|
|
on erp_material.id = file.rel_id |
|
|
on erp_material.id = file.rel_id |
|
|
where erp.parent_id = #{parentId} |
|
|
where erp.parent_id in (#{parentId}) |
|
|
</select> |
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |