Commit 039e4d92 authored by suhuiguang's avatar suhuiguang

fix(重要提醒):存量数据刷刷数据中质量登记

1.设备刷 2.装置刷
parent cf37f066
...@@ -219,4 +219,12 @@ public class DataHandlerController extends BaseController { ...@@ -219,4 +219,12 @@ public class DataHandlerController extends BaseController {
public ResponseModel<String> writeEstateUnitInfoInUseInfo() { public ResponseModel<String> writeEstateUnitInfoInUseInfo() {
return ResponseHelper.buildResponse(dataHandlerService.writeEstateUnitInfoInUseInfo()); return ResponseHelper.buildResponse(dataHandlerService.writeEstateUnitInfoInUseInfo());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "put", value = "历史设备装置初始化数据质量等级", notes = "车用气瓶登记产权单位信息刷入useInfo表")
@PutMapping(value = "/initDataQualityScore")
public ResponseModel<String> initDataQualityScore(){
return ResponseHelper.buildResponse(dataHandlerService.initDataQualityScore());
}
} }
package com.yeejoin.amos.boot.module.ymt.api.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class EquipWaitRefreshDataQualityScore {
private String record;
private Integer dataQualityScore;
}
package com.yeejoin.amos.boot.module.ymt.api.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
public class ProjectWaitRefreshDataQualityScore {
private Long projectContraptionId;
private Integer dataQualityScore;
}
package com.yeejoin.amos.boot.module.ymt.api.dto;
import lombok.Data;
@Data
public class RefreshDataDto {
private String record;
private Boolean isIntoManagement;
private String useInnerCode;
private String factoryNum;
private String useOrgCode;
private String equList;
private String equCategory;
private String equDefine;
private String whetherVehicleCylinder;
}
...@@ -305,5 +305,4 @@ public class IdxBizJgProjectContraption extends BaseEntity { ...@@ -305,5 +305,4 @@ public class IdxBizJgProjectContraption extends BaseEntity {
*/ */
@TableField("data_quality_score") @TableField("data_quality_score")
private String dataQualityScore; private String dataQualityScore;
} }
...@@ -326,4 +326,11 @@ public class IdxBizJgUseInfo extends TzsBaseEntity implements IBaseChangeData { ...@@ -326,4 +326,11 @@ public class IdxBizJgUseInfo extends TzsBaseEntity implements IBaseChangeData {
*/ */
@TableField("\"DATA_QUALITY_SCORE\"") @TableField("\"DATA_QUALITY_SCORE\"")
private Integer dataQualityScore; private Integer dataQualityScore;
/**
* 刷库专用字段
*/
@TableField("\"VERSION\"")
private String version;
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ymt.api.dto.ProjectWaitRefreshDataQualityScore;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -110,4 +111,5 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro ...@@ -110,4 +111,5 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
List<Map<String, Object>> selectPipelineList(@Param("equIds") List<String> equIds); List<Map<String, Object>> selectPipelineList(@Param("equIds") List<String> equIds);
void updateDataQualityScoreBatch(@Param("projectContraptions") List<ProjectWaitRefreshDataQualityScore> projectContraptions);
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ymt.api.mapper; package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipWaitRefreshDataQualityScore;
import com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
...@@ -15,4 +18,10 @@ public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> { ...@@ -15,4 +18,10 @@ public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> {
void batchUpdateUseInfo(@Param("records") List<String> records, Integer code); void batchUpdateUseInfo(@Param("records") List<String> records, Integer code);
List<IdxBizJgUseInfo> selectXAList(); List<IdxBizJgUseInfo> selectXAList();
List<RefreshDataDto> selectUseInfoOfOneVersion(Integer version);
Integer selectMaxVersion();
void updateDataQualityScoreBatch(@Param("equips") List<EquipWaitRefreshDataQualityScore> refreshDataQualityScores, @Param("version") int version);
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper">
<select id="getDetail" resultType="java.util.Map"> <select id="getDetail" resultType="java.util.Map">
SELECT SELECT
SEQUENCE_NBR, SEQUENCE_NBR,
...@@ -610,4 +609,10 @@ ...@@ -610,4 +609,10 @@
GROUP BY a.project_contraption_id GROUP BY a.project_contraption_id
) GROUP BY project_contraption_id ) GROUP BY project_contraption_id
</select> </select>
<update id="updateDataQualityScoreBatch">
<foreach collection="projectContraptions" separator=";" item="projectContraption" open="" close="">
UPDATE idx_biz_jg_project_contraption SET data_quality_score = #{projectContraption.dataQualityScore} WHERE sequence_nbr = #{projectContraption.projectContraptionId}
</foreach>
</update>
</mapper> </mapper>
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
#{record} #{record}
</foreach> </foreach>
</update> </update>
<update id="updateDataQualityScoreBatch">
<foreach collection="equips" separator=";" item="equip" open="" close="">
UPDATE idx_biz_jg_use_info SET "DATA_QUALITY_SCORE" = #{equip.dataQualityScore} , "VERSION"=#{version} WHERE record = #{equip.record}
</foreach>
</update>
<select id="selectXAList" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo"> <select id="selectXAList" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo">
select select
u."SEQUENCE_NBR", u."SEQUENCE_NBR",
...@@ -23,4 +28,31 @@ ...@@ -23,4 +28,31 @@
) )
and u."USE_UNIT_NAME" <![CDATA[ <> ]]> '' and u."USE_UNIT_NAME" <![CDATA[ <> ]]> ''
</select> </select>
<select id="selectUseInfoOfOneVersion" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto">
SELECT
ui.record,
ui.is_into_management,
ui.use_inner_code,
fi.factory_num,
jri.use_org_code,
jri.equ_list,
jri.EQU_CATEGORY,
jri.EQU_DEFINE,
jri.WHETHER_VEHICLE_CYLINDER
from
"idx_biz_jg_use_info" ui
LEFT JOIN idx_biz_jg_register_info jri ON jri.RECORD = ui.RECORD
LEFT JOIN idx_biz_jg_factory_info fi on fi."RECORD" = ui."RECORD"
where
jri.EQU_LIST !='8000'
AND (ui.VERSION <![CDATA[ <> ]]> 1 or ui.VERSION is null)
and jri.EQU_CATEGORY <![CDATA[ <> ]]> ''
and ui.is_into_management is not null
limit 10000
</select>
<select id="selectMaxVersion" resultType="java.lang.Integer">
SELECT
COALESCE(MAX(version),0) as version
FROM "idx_biz_jg_use_info"
</select>
</mapper> </mapper>
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