Commit 1bf82271 authored by 曹盼盼's avatar 曹盼盼

修改监察综合值守系统适配sql问题

parent 9c7f6a51
...@@ -3,19 +3,20 @@ ...@@ -3,19 +3,20 @@
<mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.IdxUjerMapper"> <mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.IdxUjerMapper">
<select id="getPageByOver" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.IdxUjerDto"> <select id="getPageByOver" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.IdxUjerDto">
SELECT SELECT
a.`BUSINESS_NAME` as businessName, a.BUSINESS_NAME as businessName,
a.`CREDIT_CODE` as creditCode, a.CREDIT_CODE as creditCode,
a.`BUSINESS_TYPE` as businessType, a.BUSINESS_TYPE as businessType,
a.`BUSINESS_ADDRESS` as businessAddress, a.BUSINESS_ADDRESS as businessAddress,
a.`CONTACTS` as contacts, a.CONTACTS as contacts,
a.`CONTACT_NUMBER` as contactNumber, a.CONTACT_NUMBER as contactNumber,
a.`COMPANYID` as companyId, a.COMPANYID as companyId,
IF(b.SEQUENCE_NBR is null, '未建', '已建') as bizType IF(b.SEQUENCE_NBR is null, '未建', '已建') as bizType
FROM idx_biz_ujer b FROM idx_biz_ujer b
LEFT JOIN LEFT JOIN
(SELECT * FROM (SELECT * FROM
idx_biz_odgu idx_biz_odgu
GROUP BY BUSINESS_NAME) a on a.BUSINESS_NAME = b.BUSINESS_NAME GROUP BY BUSINESS_NAME) a on a.BUSINESS_NAME = b.BUSINESS_NAME
<where> <where>
<if test="ids !=null and ids.size()>0"> <if test="ids !=null and ids.size()>0">
AND a.companyId in AND a.companyId in
...@@ -34,20 +35,19 @@ ...@@ -34,20 +35,19 @@
<select id="getPageByMust" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.IdxUjerDto"> <select id="getPageByMust" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.IdxUjerDto">
SELECT SELECT
a.`BUSINESS_NAME` as businessName, a.BUSINESS_NAME as businessName,
a.`CREDIT_CODE` as creditCode, a.CREDIT_CODE as creditCode,
a.`BUSINESS_TYPE` as businessType, a.BUSINESS_TYPE as businessType,
a.`BUSINESS_ADDRESS` as businessAddress, a.BUSINESS_ADDRESS as businessAddress,
a.`CONTACTS` as contacts, a.CONTACTS as contacts,
a.`CONTACT_NUMBER` as contactNumber, a.CONTACT_NUMBER as contactNumber,
a.`COMPANYID` as companyId, a.COMPANYID as companyId,
IF(b.SEQUENCE_NBR is null, '未建', '已建') as bizType IF(b.SEQUENCE_NBR is null, '未建', '已建') as bizType
FROM idx_biz_odgu a FROM idx_biz_odgu a
LEFT JOIN LEFT JOIN
(SELECT * FROM (SELECT * FROM
idx_biz_ujer idx_biz_ujer
GROUP BY BUSINESS_NAME) b on a.BUSINESS_NAME = b.BUSINESS_NAME GROUP BY BUSINESS_NAME) b on a.BUSINESS_NAME = b.BUSINESS_NAME
<where> <where>
<if test="ids !=null and ids.size()>0"> <if test="ids !=null and ids.size()>0">
AND a.companyId in AND a.companyId in
...@@ -65,6 +65,6 @@ ...@@ -65,6 +65,6 @@
</select> </select>
<select id="getCompanyInfo" resultType="java.util.Map"> <select id="getCompanyInfo" resultType="java.util.Map">
SELECT ID AS companyId, `NAME` AS companyName FROM privilege_company_qyszyfjs SELECT ID AS companyId, privilege_company_qyszyfjs.NAME AS companyName FROM privilege_company_qyszyfjs
</select> </select>
</mapper> </mapper>
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
resultType="com.yeejoin.amos.boot.module.tzs.api.dto.TzBaseEnterpriseInfoDto"> resultType="com.yeejoin.amos.boot.module.tzs.api.dto.TzBaseEnterpriseInfoDto">
SELECT SELECT
*, *,
CONCAT(province,"/",city,"/",district) AS region, CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,"/",address) AS full_address CONCAT(street,'/',address) AS full_address
FROM FROM
tz_base_enterprise_info tz_base_enterprise_info
<where> <where>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' "> test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' ">
AND CONCAT(province,"/",city,"/",district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%') AND CONCAT(province,'/',city,'/',district) LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.region},'%')
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' "> test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' ">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
use1.estate_unit_name, use1.estate_unit_name,
registration.equ_code, registration.equ_code,
registration.equ_category, registration.equ_category,
ec.`name` AS equ_define, ec.name AS equ_define,
registration.equ_define AS equ_define_code, registration.equ_define AS equ_define_code,
other.code96333, other.code96333,
registration.use_org_code, registration.use_org_code,
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
LEFT JOIN LEFT JOIN
tz_jg_produce_info produce ON produce.sequence_code = tz_jg_produce_info produce ON produce.sequence_code =
supervise.sequence_code supervise.sequence_code
LEFT JOIN tz_equipment_category ec ON ec.`code` = registration.equ_define LEFT JOIN tz_equipment_category ec ON ec.code = registration.equ_define
LEFT JOIN tz_jg_construction_info cons ON cons.sequence_code = supervise.sequence_code LEFT JOIN tz_jg_construction_info cons ON cons.sequence_code = supervise.sequence_code
<where> <where>
<if test="categoryCodes != null and categoryCodes.size>0"> <if test="categoryCodes != null and categoryCodes.size>0">
......
...@@ -182,6 +182,7 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -182,6 +182,7 @@ public class InspectionServiceImpl implements InspectionService {
@Override @Override
public JSONObject getSafetySupervisionCodeMap(String bizTable, String mapKey, String mapValue) { public JSONObject getSafetySupervisionCodeMap(String bizTable, String mapKey, String mapValue) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String sql = String.format("SELECT %s, %s FROM %s", mapKey, mapValue, bizTable); String sql = String.format("SELECT %s, %s FROM %s", mapKey, mapValue, bizTable);
List<Map<String, Object>> list = bizJdbcTemplate.queryForList(sql); List<Map<String, Object>> list = bizJdbcTemplate.queryForList(sql);
list.forEach(x -> { list.forEach(x -> {
......
...@@ -112,14 +112,14 @@ public class TzsJgServiceImpl implements ITzsJgService { ...@@ -112,14 +112,14 @@ public class TzsJgServiceImpl implements ITzsJgService {
@Override @Override
public IPage<TzsJgBasicInfoDto> page(PageParam pageParam, TzsJgBasicInfoDto tzsJgBasicInfoDto) { public IPage<TzsJgBasicInfoDto> page(PageParam pageParam, TzsJgBasicInfoDto tzsJgBasicInfoDto) {
Set<String> categoryCodes = new HashSet<>(); Set<String> categoryCodes = new HashSet<>();
if (tzsJgBasicInfoDto.getSuperviseKey() != null) { if (!ValidationUtil.isEmpty(tzsJgBasicInfoDto.getSuperviseKey()) ) {
FeignClientResult<CompanyModel> result = Privilege.companyClient FeignClientResult<CompanyModel> result = Privilege.companyClient
.seleteOne(Long.valueOf(tzsJgBasicInfoDto.getSuperviseKey())); .seleteOne(Long.valueOf(tzsJgBasicInfoDto.getSuperviseKey()));
if (result.getResult() != null) { if (result.getResult() != null) {
tzsJgBasicInfoDto.setOrgBranchCode(result.getResult().getOrgCode()); tzsJgBasicInfoDto.setOrgBranchCode(result.getResult().getOrgCode());
} }
} }
if (tzsJgBasicInfoDto.getEquDefine() != null) { if ( !ValidationUtil.isEmpty(tzsJgBasicInfoDto.getEquDefine()) ) {
// EquipmentCategory equipmentCategory = equipmentCategoryServiceImpl // EquipmentCategory equipmentCategory = equipmentCategoryServiceImpl
// .getOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getId, // .getOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getId,
// tzsJgBasicInfoDto.getEquCategory())); // tzsJgBasicInfoDto.getEquCategory()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment