Commit c58b2f05 authored by 韩桐桐's avatar 韩桐桐

fix(jg):启用停用列表查询修改

parent fe028662
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -52,6 +51,33 @@ public class JgEnableDisableDto extends BaseDto {
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "申请日期,接收查询参数")
private String applicationDate;
@ApiModelProperty("设备品种")
private String equDefine;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationCode;
@ApiModelProperty(value = "96333识别码")
private String code96333;
@ApiModelProperty(value = "设备地址")
private String address;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
@ApiModelProperty(value = "创建人")
private String createUserName;
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
......@@ -17,6 +18,7 @@ import java.util.Map;
public interface JgEnableDisableMapper extends BaseMapper<JgEnableDisable> {
Page<Map<String, Object>> pageList(@Param("page") Page<Map<String, Object>> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgEnableDisableDto dto,
@Param("type") String type,
@Param("userId") String userId);
......
......@@ -4,24 +4,23 @@
<select id="pageList" resultType="java.util.Map">
SELECT
CASE
when jed.apply_type = 'SB_TY' then '设备停用'
else '设备启用' end as applyType,
jed.sequence_nbr as sequenceNbr,
jed.apply_no as applyNo,
date_format(jed.apply_date, '%Y-%m-%d') as applyDate,
CASE
when
jed.apply_type = 'SB_TY' then '停用'
else '启用' end as applyType,
date_format(jed.audit_pass_date, '%Y-%m-%d') as auditPassDate,
jri.USE_ORG_CODE as useOrgCode,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE AS equCode,
jri.USE_ORG_CODE AS useRegistrationCode,
use.USE_UNIT_NAME as useUnitName,
jed.receive_org_name as receiveOrgName,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME", '',
use."ADDRESS") as address,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME") as address,
use."ADDRESS" as detailedAddress,
use."USE_INNER_CODE" as useInnerCode,
jed.audit_status as auditStatus,
date_format(jed.audit_pass_date, '%Y-%m-%d') as auditPassDate,
jed.instance_id as instanceId,
jed.execute_sequence as executeSequence,
jed.next_executor_ids as nextExecutorIds,
......@@ -29,12 +28,16 @@
jed.next_execute_user_ids as nextExecuteUserIds,
jed.create_user_id as createUserId,
jed.next_task_id as nextTaskId,
(select SUPERVISORY_CODE from idx_biz_jg_other_info oi where jri.RECORD = oi.RECORD) as supervisoryCode
oi.SUPERVISORY_CODE AS supervisoryCode,
oi.CODE96333 as code96333,
(SELECT name from tz_equipment_category WHERE code = jri.EQU_LIST) AS equList,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine
FROM tzs_jg_enable_disable jed
LEFT JOIN tzs_jg_enable_disable_eq jede on jed.sequence_nbr = jede.enable_disable_apply_id
LEFT JOIN idx_biz_jg_register_info jri on jede.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on jri.RECORD = use.RECORD
LEFT JOIN idx_biz_jg_other_info oi ON oi.RECORD = jede.equ_id
<where>
jed.is_delete = 0
<if test="dto.applyNo != null and dto.applyNo != '' ">
......@@ -56,8 +59,44 @@
<if test="dto.applyType != null and dto.applyType != ''">
and jed.apply_type = #{dto.applyType}
</if>
<if test="dto.applicationDate != null and dto.applicationDate != ''">
and jed.apply_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equList != null and dto.equList != ''">
AND jri."EQU_LIST" = #{dto.equList}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
AND jri."equ_category" = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
AND jri."EQU_DEFINE" = #{dto.equDefine}
</if>
<if test="dto.equCode != null and dto.equCode != ''">
AND jri."EQU_CODE" like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND jri."USE_ORG_CODE" like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
AND oi.CODE96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND oi.SUPERVISORY_CODE like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.address != null and dto.address != ''">
AND (
use."PROVINCE_NAME" LIKE CONCAT('%', #{dto.address}, '%')
OR use."CITY_NAME" LIKE CONCAT('%', #{dto.address}, '%')
OR use."COUNTY_NAME" LIKE CONCAT('%', #{dto.address}, '%')
OR use."STREET_NAME" LIKE CONCAT('%', #{dto.address}, '%')
)
</if>
</where>
order by jed.rec_date desc
order by
<if test="sort != null">
jed.${sort.field} ${sort.sortType},
</if>
jed.rec_date desc
</select>
<select id="getDetail" resultType="java.util.Map">
SELECT jed.sequence_nbr as sequenceNbr,
......
......@@ -53,11 +53,12 @@ public class JgEnableDisableController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "使用登记设备关系表分页查询", notes = "使用登记设备关系表分页查询")
public ResponseModel<Page<Map<String, Object>>> page(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "sort",required = false) String sort,
JgEnableDisableDto dto) {
Page<Map<String, Object>> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.pageList(page, dto));
return ResponseHelper.buildResponse(jgEnableDisableServiceImpl.pageList(page,sort, dto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
......@@ -363,7 +364,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
public Page<Map<String, Object>> pageList(Page<Map<String, Object>> page, JgEnableDisableDto dto) {
public Page<Map<String, Object>> pageList(Page<Map<String, Object>> page,String sort, JgEnableDisableDto dto) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if ("company".equals(reginParams.getCompany().getLevel())) {
dto.setUseUnitCreditCode(reginParams.getCompany().getCompanyCode());
......@@ -372,7 +373,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
}
String level = reginParams.getCompany().getLevel();
String userId = reginParams.getUserModel().getUserId();
return this.baseMapper.pageList(page, dto, level,userId);
SortVo sortMap = commonService.sortFieldConversion(sort);
return this.baseMapper.pageList(page,sortMap, dto, level,userId);
}
......
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