标准预警导出

This commit is contained in:
庄新伟
2022-03-15 13:31:28 +08:00
parent af846f74e0
commit f9f4c0c0b4
3 changed files with 24 additions and 6 deletions
@@ -17,4 +17,6 @@ public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
List<WarningExportVO> exportWarning(@Param("idList") List<String> ids);
String exportShow(@Param("str") List<String> str);
}
@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.List;
@Service("EarlyWarningEOService")
@@ -123,6 +124,14 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
@Override
public List<WarningExportVO> getExportExcel(WarningExcelVO excelVO){
List<WarningExportVO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
for(WarningExportVO vo:standWarningEOList){
if (vo.getApplyType() == null || vo.getApplyType().equals("")){
vo.setApplyTypeShow(null);
}else {
List<String> str = Arrays.asList(vo.getApplyType().split(","));
vo.setApplyTypeShow(earlyWarningEODao.exportShow(str));
}
}
// IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, null);
return standWarningEOList;
@@ -99,7 +99,6 @@
SELECT
<include refid="export_column"/> ,
dicType.DIC_TYPE_NAME AS applyTypeShow,
attr.CLLX AS APPLY_TYPE ,
attr.ZRGCS AS DUTY_ENGINEER ,
NULL AS ITEM_ID ,
@@ -115,7 +114,6 @@
FROM sar_stand_warning AS warning
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
LEFT JOIN ts_dictype as dicType on (attr.CLLX = dicType.DIC_TYPE_CODE AND attr.CLLX !=null AND attr.CLLX != '')
<where>
POWER = '1'
AND (MARK = 'stand')
@@ -137,7 +135,6 @@
SELECT
<include refid="export_column"/> ,
dicType.DIC_TYPE_NAME AS applyTypeShow,
items.APPLY_ARCTIC AS APPLY_TYPE ,
items.DUTY_ENGINEER AS DUTY_ENGINEER ,
items.ID AS ITEM_ID ,
@@ -155,7 +152,6 @@
LEFT JOIN sar_standards_info AS sarInfo ON sarInfo.id = warning.STAND_ID
LEFT JOIN sar_stand_items AS items ON items.ID = warning.ITEM_ID
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
LEFT JOIN ts_dictype as dicType on (dicType.DIC_TYPE_CODE = items.APPLY_ARCTIC AND items.APPLY_ARCTIC !=null AND items.APPLY_ARCTIC != '')
<where>
POWER = '1'
AND (MARK = 'item')
@@ -293,6 +289,17 @@
ORDER BY warning_date.SSRQ_MIN
</select>
<select id="exportShow" resultType="java.lang.String">
SELECT
group_concat( td.DIC_TYPE_NAME SEPARATOR ',' ) as applyTypeShow
FROM
ts_dictype td
WHERE
td.DIC_TYPE_CODE
IN
<foreach collection="str" item="dicTypeCode" open="(" close=")" separator=",">
<!-- 每个遍历需要生成的串 -->
#{dicTypeCode}
</foreach>
</select>
</mapper>