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

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

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