Commit 8af3eaac authored by 韩桐桐's avatar 韩桐桐

fix(jg):使用登记列表查询修改

parent 05bafe29
......@@ -61,6 +61,9 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "注册登记日期")
private Date regDate;
@ApiModelProperty(value = "申请日期")
private String applicationDate;
@ApiModelProperty(value = "注册登记人员ID")
private String regPersonId;
......@@ -91,6 +94,9 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "设备类别")
private String equDefine;
@ApiModelProperty(value = "设备代码")
private String equCode;
......@@ -116,4 +122,16 @@ public class JgUseRegistrationDto extends BaseDto {
*/
@ApiModelProperty(value = "办理类型")
private String manageType;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationCode;
@ApiModelProperty(value = "96333识别代码")
private String code96333;
@ApiModelProperty(value = "设备地址")
private String fullAddress;
@ApiModelProperty(value = "接收单位")
private String receiveCompanyCode;
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -18,7 +19,10 @@ import java.util.Map;
*/
public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page, @Param("dto") JgUseRegistrationDto dto , @Param("roleIds") List<String> roleIds);
Page<Map<String, Object>> getListPage(@Param("page")Page<Map<String, Object>> page,
@Param("sort") SortVo sortMap,
@Param("dto") JgUseRegistrationDto dto ,
@Param("roleIds") List<String> roleIds);
Map<String, Object> getDetail(@Param("id")String id);
......
......@@ -8,7 +8,7 @@
<sql id="page-list">
select ur.sequence_nbr as sequenceNbr,
ur.audit_status as auditStatus,
date_format(reg_date,'%Y-%m-%d') as regDate,
date_format(ur.reg_date,'%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.status,
ur.receive_org_name as receiveOrgName,
......@@ -28,6 +28,7 @@
ur.manage_type as manageType,
GROUP_CONCAT(DISTINCT other.CODE96333) AS code96333,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY)) as equCategory,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_DEFINE)) as equDefine,
GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY) AS equCategoryCode,
GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME) AS productName,
GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY) AS equCategoryCode,
......@@ -35,12 +36,16 @@
GROUP_CONCAT(DISTINCT jri.EQU_LIST) AS equList,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_LIST)) AS equListName,
GROUP_CONCAT(DISTINCT use.USE_INNER_CODE) AS innerCode,
GROUP_CONCAT(DISTINCT re.equ_id) AS equipId
GROUP_CONCAT(DISTINCT re.equ_id) AS equipId,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME") as fullAddress,
use."ADDRESS" as detailedAddress,
ibjsi.ORG_BRANCH_NAME as orgBranchName
from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
LEFT JOIN idx_biz_jg_supervision_info ibjsi on re.equ_id = ibjsi.RECORD
</sql>
<select id="getListPage" resultType="java.util.Map">
......@@ -56,15 +61,41 @@
<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.status != null and dto.status != ''">
and ur.status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
and ur.reg_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
and other.CODE96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
and other.supervisory_code like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND (
use."PROVINCE_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."CITY_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."COUNTY_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."STREET_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
)
</if>
<if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
AND ur.receive_company_code = #{dto.receiveCompanyCode}
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="roleIds != null and dto.dataType == 'supervision'">
<foreach collection='roleIds' item='role' open='and (' close=')' separator='or'>
instance_status like concat('%',#{role},'%')
......@@ -90,18 +121,48 @@
<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.status != null and dto.status != ''">
and ur.status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
and ur.reg_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and jri.EQU_CODE like concat('%',#{dto.equCode},'%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
and other.CODE96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
and other.supervisory_code like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND (
use."PROVINCE_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."CITY_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."COUNTY_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
OR use."STREET_NAME" LIKE CONCAT('%', #{dto.fullAddress}, '%')
)
</if>
<if test="dto.receiveCompanyCode != null and dto.receiveCompanyCode != ''">
AND ur.receive_company_code = #{dto.receiveCompanyCode}
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and ur.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
GROUP BY re.equip_transfer_id
</where>)
order by regDate desc, recDate desc
order by
<if test="sort != null">
ur.${sort.field} ${sort.sortType},
</if>
regDate desc, recDate desc
</select>
<select id="getDetail" resultType="java.util.Map">
SELECT
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
......@@ -92,6 +93,7 @@ public class JgUseRegistrationController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getList")
public ResponseModel<Page<Map<String, Object>>> getList(JgUseRegistrationDto dto,
@ApiParam(value = "排序字段",required = false) @RequestParam(value = "sort",required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<Map<String, Object>> page = new Page<>(current, size);
......@@ -103,7 +105,7 @@ public class JgUseRegistrationController extends BaseController {
} else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
}
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto, page, dto.getRoleIds());
Page<Map<String, Object>> list = jgUseRegistrationServiceImpl.getList(dto,sort, page, dto.getRoleIds());
list.getRecords().forEach(x-> x.put("companyType",info.getCompany().getCompanyType()));
return ResponseHelper.buildResponse(list);
}
......
......@@ -28,6 +28,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationService;
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.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil;
......@@ -158,8 +159,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
exportParamsMap.put("giveOutDay", today.getDayOfMonth());
}
public Page<Map<String, Object>> getList(JgUseRegistrationDto dto, Page<Map<String, Object>> page, List<String> roleIds) {
return this.baseMapper.getListPage(page, dto, roleIds);
public Page<Map<String, Object>> getList(JgUseRegistrationDto dto,String sort, Page<Map<String, Object>> page, List<String> roleIds) {
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
return this.baseMapper.getListPage(page,sortMap, dto, roleIds);
}
public Page<Map<String, Object>> getEquipList(Page<Map<String, Object>> page, String factoryNum, String equList, String equCategory) {
......
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