Browse Source

更新

master
常熟吴彦祖 3 weeks ago
parent
commit
8ed7d44f90
  1. 11
      src/main/java/com/xujie/modules/qms/service/impl/QcServiceImpl.java
  2. 32
      src/main/resources/mapper/qms/QcMapper.xml
  3. 2
      src/main/resources/mapper/sys/SysDepartmentMapper.xml

11
src/main/java/com/xujie/modules/qms/service/impl/QcServiceImpl.java

@ -189,9 +189,9 @@ public class QcServiceImpl implements QcService {
@Override @Override
public PageUtils qcItemSearch(QcItemData data) { public PageUtils qcItemSearch(QcItemData data) {
IPage<QcItemData> list; IPage<QcItemData> list;
if (data.getSite().equals("***")){
if ("***".equals(data.getSite())) {
list = this.qcMapper.qcLcItemSearch(new Page<QcItemData>(data.getPage(), data.getLimit()), data); list = this.qcMapper.qcLcItemSearch(new Page<QcItemData>(data.getPage(), data.getLimit()), data);
}else {
} else {
list = this.qcMapper.qcItemSearch(new Page<QcItemData>(data.getPage(), data.getLimit()), data); list = this.qcMapper.qcItemSearch(new Page<QcItemData>(data.getPage(), data.getLimit()), data);
} }
return new PageUtils(list); return new PageUtils(list);
@ -491,9 +491,9 @@ public class QcServiceImpl implements QcService {
@Override @Override
public PageUtils templateSearch(QcTemplateData data) { public PageUtils templateSearch(QcTemplateData data) {
IPage<QcTemplateData> resultList; IPage<QcTemplateData> resultList;
if (data.getSite().equals("***")){
if ("***".equals(data.getSite())) {
resultList = this.qcMapper.templateSearch2(new Page<QcTemplateData>(data.getPage(), data.getLimit()), data); resultList = this.qcMapper.templateSearch2(new Page<QcTemplateData>(data.getPage(), data.getLimit()), data);
}else {
} else {
resultList = this.qcMapper.templateSearch(new Page<QcTemplateData>(data.getPage(), data.getLimit()), data); resultList = this.qcMapper.templateSearch(new Page<QcTemplateData>(data.getPage(), data.getLimit()), data);
} }
@ -1640,7 +1640,6 @@ public class QcServiceImpl implements QcService {
@Override @Override
@Transactional @Transactional
public PageUtils qcFAIInspectionSearch(QcFAIRecordData data) { public PageUtils qcFAIInspectionSearch(QcFAIRecordData data) {
// 查询FAI主记录信息
IPage<QcFAIRecordData> resultList = this.qcMapper.qcFAIInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data); IPage<QcFAIRecordData> resultList = this.qcMapper.qcFAIInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data);
return new PageUtils(resultList); return new PageUtils(resultList);
} }
@ -2046,7 +2045,6 @@ public class QcServiceImpl implements QcService {
**/ **/
@Override @Override
public PageUtils qcFQCInspectionSearch(QcFAIRecordData data) { public PageUtils qcFQCInspectionSearch(QcFAIRecordData data) {
// 查询FQC主记录信息
IPage<QcFAIRecordData> resultList = this.qcMapper.qcFQCInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data); IPage<QcFAIRecordData> resultList = this.qcMapper.qcFQCInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data);
return new PageUtils(resultList); return new PageUtils(resultList);
} }
@ -2375,7 +2373,6 @@ public class QcServiceImpl implements QcService {
@Override @Override
@Transactional @Transactional
public PageUtils qcIPQCInspectionSearch(QcFAIRecordData data) { public PageUtils qcIPQCInspectionSearch(QcFAIRecordData data) {
// 查询FAI主记录信息
IPage<QcFAIRecordData> resultList = this.qcMapper.qcIPQCInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data); IPage<QcFAIRecordData> resultList = this.qcMapper.qcIPQCInspectionSearch(new Page<QcFAIRecordData>(data.getPage(), data.getLimit()), data);
return new PageUtils(resultList); return new PageUtils(resultList);
} }

32
src/main/resources/mapper/qms/QcMapper.xml

@ -24,7 +24,7 @@
FROM qc_method as qm FROM qc_method as qm
LEFT JOIN qc_inspection_type as qit on qm.site = qit.site and qm.inspection_type_no = qit.inspection_type_no LEFT JOIN qc_inspection_type as qit on qm.site = qit.site and qm.inspection_type_no = qit.inspection_type_no
<where> <where>
qm.site in (select site from eam_access_site where username = #{query.userName})
qm.site = #{query.site}
<if test="query.methodNo != null and query.methodNo != ''"> <if test="query.methodNo != null and query.methodNo != ''">
AND qm.method_no LIKE '%' + #{query.methodNo} +'%' AND qm.method_no LIKE '%' + #{query.methodNo} +'%'
</if> </if>
@ -128,7 +128,7 @@
left join qc_sampling_inspection_programme as qsip on qsip.site = epi.site and qsip.sampling_programme_no = epi.sampling_programme_no and qsip.bu_no = epi.bu_no left join qc_sampling_inspection_programme as qsip on qsip.site = epi.site and qsip.sampling_programme_no = epi.sampling_programme_no and qsip.bu_no = epi.bu_no
left join qc_sampling_inspection_level as qsil on qsil.site = epi.site and qsil.sampling_level_no = epi.sampling_level_no and qsil.bu_no = epi.bu_no left join qc_sampling_inspection_level as qsil on qsil.site = epi.site and qsil.sampling_level_no = epi.sampling_level_no and qsil.bu_no = epi.bu_no
<where> <where>
epi.site in (select site from eam_access_site where username = #{query.userName})
epi.site = #{query.site}
and (epi.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (epi.bu_no) in (select * from dbo.query_bu(#{query.userName}))
and epi.ItemType = #{query.itemType} and epi.ItemType = #{query.itemType}
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
@ -302,7 +302,7 @@
LEFT JOIN qc_sampling_inspection_qty_rank as qsiqr ON qsip.sampling_qty_rank_no = qsiqr.sampling_qty_rank_no and qsip.site = qsiqr.site and qsip.bu_no = qsiqr.bu_no LEFT JOIN qc_sampling_inspection_qty_rank as qsiqr ON qsip.sampling_qty_rank_no = qsiqr.sampling_qty_rank_no and qsip.site = qsiqr.site and qsip.bu_no = qsiqr.bu_no
LEFT JOIN qc_sampling_inspection_level as qsil ON qsip.sampling_level_no = qsil.sampling_level_no and qsip.site = qsil.site and qsip.bu_no = qsil.bu_no LEFT JOIN qc_sampling_inspection_level as qsil ON qsip.sampling_level_no = qsil.sampling_level_no and qsip.site = qsil.site and qsip.bu_no = qsil.bu_no
<where> <where>
qsip.site in (select site from eam_access_site where username = #{query.userName})
qsip.site = #{query.site}
and (qsip.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (qsip.bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( qsip.site, qsip.bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( qsip.site, qsip.bu_no ) = #{query.buDesc}
@ -422,7 +422,7 @@
LEFT JOIN qc_sampling_inspection_level as qsil on qt.sampling_level_no = qsil.sampling_level_no and qt.site = qsil.site and qt.bu_no = qsil.bu_no LEFT JOIN qc_sampling_inspection_level as qsil on qt.sampling_level_no = qsil.sampling_level_no and qt.site = qsil.site and qt.bu_no = qsil.bu_no
LEFT JOIN qc_sampling_inspection_programme as qsip on qt.sampling_programme_no = qsip.sampling_programme_no and qt.site = qsip.site and qt.bu_no = qsip.bu_no LEFT JOIN qc_sampling_inspection_programme as qsip on qt.sampling_programme_no = qsip.sampling_programme_no and qt.site = qsip.site and qt.bu_no = qsip.bu_no
<where> <where>
qt.site in (select site from eam_access_site where username = #{query.userName})
qt.site = #{query.site}
and (qt.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (qt.bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( qt.site, qt.bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( qt.site, qt.bu_no ) = #{query.buDesc}
@ -742,7 +742,7 @@
dbo.getOperatorDesc(site, update_by) as updateByDesc dbo.getOperatorDesc(site, update_by) as updateByDesc
FROM qc_sampling_inspection_qty FROM qc_sampling_inspection_qty
<where> <where>
site in (select site from eam_access_site where username = #{query.userName})
site = #{query.site}
and (bu_no) in (select * from dbo.query_bu(#{query.userName})) and (bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc}
@ -845,7 +845,7 @@
dbo.getOperatorDesc(site, update_by) as updateByDesc dbo.getOperatorDesc(site, update_by) as updateByDesc
FROM qc_sampling_inspection_qty_rank FROM qc_sampling_inspection_qty_rank
<where> <where>
site in (select site from eam_access_site where username = #{query.userName})
site = #{query.site}
and (bu_no) in (select * from dbo.query_bu(#{query.userName})) and (bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc}
@ -948,7 +948,7 @@
dbo.getOperatorDesc(site, update_by) as updateByDesc dbo.getOperatorDesc(site, update_by) as updateByDesc
FROM qc_sampling_inspection_level FROM qc_sampling_inspection_level
<where> <where>
site in (select site from eam_access_site where username = #{query.userName})
site = #{query.site}
and (bu_no) in (select * from dbo.query_bu(#{query.userName})) and (bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc}
@ -1055,7 +1055,7 @@
FROM qc_part_attribute qa FROM qc_part_attribute qa
LEFT JOIN part p on qa.attribute_no = p.part_no and qa.site = p.site LEFT JOIN part p on qa.attribute_no = p.part_no and qa.site = p.site
<where> <where>
qa.site in (select site from eam_access_site where username = #{query.userName})
qa.site = #{query.site}
and (qa.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (qa.bu_no) in (select * from dbo.query_bu(#{query.userName}))
and qa.attribute_type = #{query.attributeType} and qa.attribute_type = #{query.attributeType}
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
@ -1511,7 +1511,7 @@
FROM qc_part_attribute as qa FROM qc_part_attribute as qa
LEFT JOIN part_family as pf on qa.attribute_no = pf.family_id and qa.site = pf.site LEFT JOIN part_family as pf on qa.attribute_no = pf.family_id and qa.site = pf.site
<where> <where>
qa.site in (select site from eam_access_site where username = #{query.userName})
qa.site = #{query.site}
and (qa.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (qa.bu_no) in (select * from dbo.query_bu(#{query.userName}))
and qa.attribute_type = #{query.attributeType} and qa.attribute_type = #{query.attributeType}
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
@ -1564,7 +1564,7 @@
dbo.getOperatorDesc(site, update_by) as updateByDesc dbo.getOperatorDesc(site, update_by) as updateByDesc
FROM qc_sampling_inspection_programme FROM qc_sampling_inspection_programme
<where> <where>
site in (select site from eam_access_site where username = #{query.userName})
site = #{query.site}
and (bu_no) in (select * from dbo.query_bu(#{query.userName})) and (bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buDesc != null and query.buDesc != ''"> <if test="query.buDesc != null and query.buDesc != ''">
AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc} AND dbo.get_bu_desc ( site, bu_no ) = #{query.buDesc}
@ -1893,7 +1893,7 @@
left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no
left join UM as um on a.site = um.site and a.um_id = um.UMID left join UM as um on a.site = um.site and a.um_id = um.UMID
<where> <where>
a.site in (select site from eam_access_site where username = #{query.userName})
a.site = #{query.site}
and (a.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buNo != null and query.buNo != ''"> <if test="query.buNo != null and query.buNo != ''">
AND a.bu_no = #{query.buNo} AND a.bu_no = #{query.buNo}
@ -2273,7 +2273,7 @@
left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no
left join UM as um on a.site = um.site and a.um_id = um.UMID left join UM as um on a.site = um.site and a.um_id = um.UMID
<where> <where>
a.site in (select site from eam_access_site where username = #{query.userName})
a.site = #{query.site}
and (a.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buNo != null and query.buNo != ''"> <if test="query.buNo != null and query.buNo != ''">
AND a.bu_no = #{query.buNo} AND a.bu_no = #{query.buNo}
@ -2587,7 +2587,7 @@
qir.roll_count qir.roll_count
FROM qc_iqc_record as qir FROM qc_iqc_record as qir
LEFT JOIN part p ON qir.part_no = p.part_no and qir.site = p.site LEFT JOIN part p ON qir.part_no = p.part_no and qir.site = p.site
WHERE qir.site in (select site from eam_access_site where username = #{userName})
WHERE qir.site = #{site}
and (qir.site + '-' + qir.bu_no) in (select * from dbo.query_bu(#{userName})) and (qir.site + '-' + qir.bu_no) in (select * from dbo.query_bu(#{userName}))
and qir.detail_flag = 'N' and qir.detail_flag = 'N'
</select> </select>
@ -2668,8 +2668,8 @@
left join srm_supplier as s on a.site = s.site and a.supplier_no = s.supplier_no left join srm_supplier as s on a.site = s.site and a.supplier_no = s.supplier_no
left join sys_user as u on a.inspector_no = u.username left join sys_user as u on a.inspector_no = u.username
<where> <where>
a.site in (select site from eam_access_site where username = #{query.userName})
and ( a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
a.site = #{query.site}
and (a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buNo != null and query.buNo != ''"> <if test="query.buNo != null and query.buNo != ''">
AND a.bu_no = #{query.buNo} AND a.bu_no = #{query.buNo}
</if> </if>
@ -3053,7 +3053,7 @@
left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no left join resource as r on a.site = r.site and a.resource_id = r.resource_id and a.work_center_no = r.work_center_no
left join UM as um on a.site = um.site and a.um_id = um.UMID left join UM as um on a.site = um.site and a.um_id = um.UMID
<where> <where>
a.site in (select site from eam_access_site where username = #{query.userName})
a.site = #{query.site}
and (a.bu_no) in (select * from dbo.query_bu(#{query.userName})) and (a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
<if test="query.buNo != null and query.buNo != ''"> <if test="query.buNo != null and query.buNo != ''">
AND a.bu_no = #{query.buNo} AND a.bu_no = #{query.buNo}

2
src/main/resources/mapper/sys/SysDepartmentMapper.xml

@ -17,7 +17,7 @@
update_by update_by
FROM sys_department FROM sys_department
<where> <where>
site in (select site from eam_access_site where username = #{query.username})
site = #{query.site}
and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = #{query.username}) and (site + '-' + bu_no) in (select (a.site + '-' + a.bu_no) from AccessBu as a left join eam_access_site as b on a.site = b.site and a.username = b.username where a.username = #{query.username})
<if test="query.departmentId != null and query.departmentId != ''"> <if test="query.departmentId != null and query.departmentId != ''">
AND department_id like '%' + #{query.departmentId} + '%' AND department_id like '%' + #{query.departmentId} + '%'

Loading…
Cancel
Save