@ -117,10 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<iftest="createBy != null and createBy != ''"> and erp.create_by = #{createBy}</if>
<iftest="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and erp.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<iftest="params.materialNo != null and params.materialNo != ''"> and erp.material_no like concat('%', #{params.materialNo}, '%')</if>
<iftest="params.bomNo != null and params.bomNo != ''"> and erp.bom_no like concat('%', #{params.bomNo}, '%')</if>
<iftest="materialNo != null and materialNo != ''"> and erp.material_no = #{materialNo}</if>
<iftest="bomNo != null and bomNo != ''"> and erp.bom_no = #{bomNo}</if>
<iftest="materialNo != null and materialNo != ''"> and erp.material_no like concat('%', #{materialNo}, '%')</if>
<iftest="bomNo != null and bomNo != ''"> and erp.bom_no like concat('%', #{bomNo}, '%')</if>
<!-- <if test="materialNo != null and materialNo != ''"> and erp.material_no = #{materialNo}</if>-->
<!-- <if test="bomNo != null and bomNo != ''"> and erp.bom_no = #{bomNo}</if>-->
<iftest="materialName != null and materialName != ''"> and erp.material_name like concat('%', #{materialName}, '%')</if>
<iftest="auditStatus != null and auditStatus != ''"> and erp.audit_status = #{auditStatus}</if>
<iftest="useStatus != null and useStatus != ''"> and erp.use_status = #{useStatus}</if>
@ -157,6 +157,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by erp.audit_status asc, erp.create_time desc
, file.url as photo_url,cate.name as material_type_name from erp_bom as erp
left join (
select id,material_no,material_name from erp_material
) erp_material
on erp.material_no = erp_material.material_no
left join(
select dict_value,dict_label from sys_dict_data
where dict_type = 'processType'
) processDict
on erp.instance_type = processDict.dict_value
left join (
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') )
) 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>
<iftest="createBy != null and createBy != ''"> and erp.create_by = #{createBy}</if>
<iftest="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and erp.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<iftest="materialNo != null and materialNo != ''"> and erp.material_no = #{materialNo}</if>
<iftest="bomNo != null and bomNo != ''"> and erp.bom_no = #{bomNo}</if>
<iftest="materialName != null and materialName != ''"> and erp.material_name = #{materialName}</if>
<iftest="auditStatus != null and auditStatus != ''"> and erp.audit_status = #{auditStatus}</if>
<iftest="useStatus != null and useStatus != ''"> and erp.use_status = #{useStatus}</if>
<iftest="materialType != null and materialType != ''"> and erp.material_type = #{materialType}</if>
<iftest="processMethod != null and processMethod != ''"> and erp.process_method = #{processMethod}</if>
<iftest="engineer != null and engineer != ''"> and erp.engineer = #{engineer}</if>
<iftest="parentId != null "> and erp.parent_id = #{parentId}</if>
<iftest="level != null "> and erp.level = #{level}</if>
<iftest="sortNo != null "> and erp.sort_no = #{sortNo}</if>
</where>
order by erp.audit_status asc, erp.create_time desc