Commit 5b690cd8 authored by suhuiguang's avatar suhuiguang

fix(jg):登记证查询

1.登记证管理查询慢
parent db7d8284
......@@ -28,6 +28,10 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap);
Page<JgUseRegistrationManageDto> queryForUnitChangePage(@Param("page") Page<JgUseRegistrationManageDto> page,
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap);
Page<JgUseRegistrationManageDto> queryForPageForJG(@Param("page") Page<JgUseRegistrationManageDto> page,
@Param("dto") JgUseRegistrationManageDto dto,
@Param("sort") SortVo sortMap, @Param("orgCode") String orgCode);
......
......@@ -82,6 +82,85 @@
</select>
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto">
<include refid="page_list"/>
FROM tzs_jg_use_registration_manage tjurm
<where>
tjurm.is_delete = 0
<if test="dto.equList != null and dto.equList != ''">
and tjurm.equ_list = #{dto.equList}
</if>
<if test="dto.equListCode != null and dto.equListCode != ''">
and tjurm.equ_list_code = #{dto.equListCode}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
and tjurm.equ_category = #{dto.equCategory}
</if>
<if test="dto.equCategoryCode != null and dto.equCategoryCode != ''">
and tjurm.equ_category_code = #{dto.equCategoryCode}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
and tjurm.equ_define = #{dto.equDefine}
</if>
<if test="dto.equDefineCode != null and dto.equDefineCode != ''">
and tjurm.equ_define_code = #{dto.equDefineCode}
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and tjurm.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and tjurm.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.certificateNo != null and dto.certificateNo != ''">
and tjurm.certificate_no = #{dto.certificateNo}
</if>
<if test="dto.auditPassDate != null and dto.auditPassDate != ''">
and tjurm.audit_pass_date like concat('%',DATE_FORMAT(#{dto.auditPassDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.certificateStatus != null and dto.certificateStatus != ''">
and tjurm.certificate_status = #{dto.certificateStatus}
</if>
<if test="dto.useUnitCreditCodeForSearch != null and dto.useUnitCreditCodeForSearch != ''">
and tjurm.use_unit_credit_code = #{dto.useUnitCreditCodeForSearch}
</if>
<if test="dto.useUnitCreditNameForSearch != null and dto.useUnitCreditNameForSearch != ''">
and tjurm.use_unit_name like concat ('%',#{dto.useUnitCreditNameForSearch},'%')
</if>
<if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
and (tjurm.receive_company_code = #{dto.receiveCompanyCode}
or tjurm.receive_company_code is null or tjurm.receive_company_code = '')
</if>
<if test="dto.dataType == 'company' ">
AND tjurm.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if test="dto.dataType == 'supervision' ">
AND tjurm.receive_company_code = #{dto.receiveCompanyCode}
</if>
<if test="dto.whetherVehicleCylinder != null and dto.whetherVehicleCylinder == 1 ">
AND tjurm.reg_type = '车用气瓶登记'
</if>
<if test="dto.isScrap != null and dto.isScrap != ''">
and tjurm.is_scrap = #{dto.isScrap}
</if>
<if test="dto.isDoBusiness != null and dto.isDoBusiness != ''">
and tjurm.is_do_business = #{dto.isDoBusiness}
</if>
<if test="dto.cityName != null and dto.cityName != ''">
and tjurm.equ_use_address LIKE CONCAT('%', #{dto.cityName}, '%')
</if>
<if test="dto.carNumber != null and dto.carNumber != ''">
and tjurm.car_number LIKE CONCAT('%', #{dto.carNumber}, '%')
</if>
<if test="dto.certInBusinessFlag != null and dto.certInBusinessFlag != '' and dto.certInBusinessFlag == 'false'">
and NOT EXISTS ( <include refid="useRegCertInBusiness"/> )
</if>
ORDER BY
<if test="sort != null">
tjurm.${sort.field} ${sort.sortType},
</if>
tjurm.create_date DESC
</where>
</select>
<select id="queryForUnitChangePage" resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto">
<include refid="page_list"/>
,estate.sequence_nbr AS estateUnitName
FROM tzs_jg_use_registration_manage tjurm
LEFT JOIN (
......
......@@ -341,7 +341,7 @@ public class JgUseRegistrationManageController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unitChange/page")
@ApiOperation(httpMethod = "GET", value = "单位变更分页查询", notes = "单位变更分页查询")
@ApiOperation(httpMethod = "GET", value = "单位变更分页查询-带产权单位", notes = "单位变更分页查询-带产权单位")
@FieldMapping({@FieldMapping.FieldMap(sourceField = "useUnitSeq", targetField = "originalUseUnitCreditCode", serviceClass = CommonServiceImpl.class, queryMethod = "queryUnitCreditInfoBySeq")})
public ResponseModel<Page<JgUseRegistrationManageDto>> queryForUnitChangePage(JgUseRegistrationManageDto dto,
@RequestParam(value = "sort", required = false) String sort,
......@@ -361,7 +361,7 @@ public class JgUseRegistrationManageController extends BaseController {
return ResponseHelper.buildResponse(page);
}
dto.setIsDoBusiness("1");
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForUnitChangePage(page, dto, sort));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -335,6 +335,20 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
}
/**
* 单位变更证-查询
*/
public Page<JgUseRegistrationManageDto> queryForUnitChangePage(Page<JgUseRegistrationManageDto> page,
JgUseRegistrationManageDto dto,
String sort) {
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
if (ApplicationFormTypeEnum.BF.getBusinessCode().equals(dto.getApplyType()) && (!CylinderTypeEnum.CYLINDER.getCode().equals(dto.getEquCategoryCode()) || dto.getRegType().equals(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName()))){
dto.setCertificateStatus(null);
dto.setIsScrap("0");
}
return jgUseRegistrationManageMapper.queryForUnitChangePage(page, dto, sortMap);
}
/**
* 分页查询证管理表-选择证使用,添加产权单位id
*/
public Page<JgUseRegistrationManageDto> queryUseRegistrationManagePage(Page<JgUseRegistrationManageDto> page,
......
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