11.26 项目维度 查询标准数据接口修改1

This commit is contained in:
yuezhihang
2021-11-26 16:41:50 +08:00
parent 93a6c6034d
commit 4c31f54a5e
2 changed files with 115 additions and 101 deletions
@@ -155,24 +155,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
page.setPageSize(findStandDto.getSize());
page.setUserId(null);
List<SarStandardsInfo> pageInfo = null;
try {
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
} catch (Exception e) {
e.printStackTrace();
}
// try {
// pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
// } catch (Exception e) {
// e.printStackTrace();
// }
List<String> standId = new ArrayList<>();
for (SarStandardsInfo standardsInfo : pageInfo){
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
standId.add(standardsInfo.getId());
}
}
// for (SarStandardsInfo standardsInfo : pageInfo){
//// if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
// standId.add(standardsInfo.getId());
//// }
// }
List<LawsDto> list=new ArrayList<>();
if (standId==null || standId.size()==0){
list = null;
}else {
// if (standId==null || standId.size()==0){
// list = null;
// }else {
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
}
// }
IPage<LawsDto> page1=new Page<>();
page1.setRecords(list);
page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size());
@@ -195,6 +195,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
List<SarStandItemsDto> res=new ArrayList<>();
List<SarStandItemsDto> chinese=new ArrayList<>();
if (null == list || list.isEmpty()){
return list;
}else {
@@ -206,20 +207,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
if (a>0){
mark=mark.substring(0,a);
}
if (null != map.get(Integer.valueOf(mark))){
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
}else {
integerList.add(Integer.valueOf(mark));
List<SarStandItemsDto> middle=new ArrayList<>();
middle.add(sarStandItemsDto);
map.put(Integer.valueOf(mark),middle);
}
try {
if (null != map.get(Integer.valueOf(mark))) {
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
} else {
integerList.add(Integer.valueOf(mark));
List<SarStandItemsDto> middle = new ArrayList<>();
middle.add(sarStandItemsDto);
map.put(Integer.valueOf(mark), middle);
}
}catch (Exception e){
chinese.add(sarStandItemsDto);
}
});
Collections.sort(integerList);
integerList.forEach(integer -> {
res.addAll(map.get(integer));
});
res.addAll(chinese);
return res;
}
}
@@ -99,95 +99,43 @@
order by number
</select>
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
and a.STAND_TYPE = #{standType}
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
UNION
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
@@ -196,21 +144,82 @@
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
</select>
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">