代码提交

This commit is contained in:
luozhun 2024-08-30 18:05:45 +08:00
parent 5a563b8625
commit 909d278772
4 changed files with 50 additions and 51 deletions

View File

@ -33,7 +33,4 @@ public class PoliceUnitController {
return policeUnitService.pager(queryParams);
}
public static void main(String[] args) {
System.out.println(JavaClassToTsUtil.parse(PoliceUnitPagerVo.class));
}
}

View File

@ -35,27 +35,7 @@ public class SecurityUnitServiceImpl extends ServiceImpl<SecurityUnitMapper, Sec
@Override
public Page<SecurityUnitPagerVo> pager(PageParams<SecurityUnitPagerQueryParams, SecurityUnitPagerVo> queryParams) {
Page<SecurityUnitPagerVo> page = queryParams.getPage();
SecurityUnitPagerQueryParams params = queryParams.getParams();
LambdaQueryWrapper<SecurityUnit> wrapper = Wrappers.<SecurityUnit>lambdaQuery()
.like(StrUtil.isNotEmpty(params.getName()), SecurityUnit::getName, params.getName())
.like(StrUtil.isNotEmpty(params.getSocialCode()), SecurityUnit::getSocialCode, params.getSocialCode());
if (params.getCheckStatus() != null) {
wrapper.eq(SecurityUnit::getCheckStatus, params.getCheckStatus().getValue());
}
if (params.getIsEnable() != null) {
wrapper.eq(SecurityUnit::getIsEnable, params.getIsEnable().getValue());
}
List<String> administrativeDivisionCodes = params.getAdministrativeDivisionCodes();
if (administrativeDivisionCodes != null) {
wrapper.eq(!administrativeDivisionCodes.isEmpty(), SecurityUnit::getProvince, administrativeDivisionCodes.get(0));
wrapper.eq(administrativeDivisionCodes.size() >= 2, SecurityUnit::getCity, administrativeDivisionCodes.get(1));
wrapper.eq(administrativeDivisionCodes.size() >= 3, SecurityUnit::getDistricts, administrativeDivisionCodes.get(2));
wrapper.eq(administrativeDivisionCodes.size() >= 4, SecurityUnit::getStreet, administrativeDivisionCodes.get(3));
}
return baseMapper.pager(page, params);
return baseMapper.pager(queryParams.getPage(), queryParams.getParams());
}
@Override

View File

@ -1,34 +1,51 @@
<?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" >
<mapper namespace="com.changhu.module.management.mapper.SecurityUnitMapper">
<select id="pager" resultType="com.changhu.module.management.pojo.vo.SecurityUnitPagerVo">
<resultMap id="SecurityUnitPagerVoResultMap" type="com.changhu.module.management.pojo.vo.SecurityUnitPagerVo">
<result
column="legal_person_info"
typeHandler="com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler"
property="legalPersonInfo"/>
</resultMap>
<select id="pager" resultMap="SecurityUnitPagerVoResultMap">
select
*
from security_unit
*,
ad1.name as provinceName,
ad2.name as cityName,
ad3.name as districtsName,
ad4.name as streetName
from
security_unit su
left join administrative_division ad1 on su.province = ad1.code and ad1.delete_flag = 0
left join administrative_division ad2 on su.city = ad2.code and ad2.delete_flag = 0
left join administrative_division ad3 on su.districts = ad3.code and ad3.delete_flag = 0
left join administrative_division ad4 on su.street = ad4.code and ad4.delete_flag = 0
where
delete_flag = 0
<if test="params.name!=null and params.name!=''">
and name like concat('%',#{params.name},'%')
</if>
<if test="params.socialCode!=null and params.socialCode!=''">
and socialCode like concat('%',#{params.socialCode},'%')
</if>
<if test="params.administrativeDivisionCodes!=null">
<if test="params.administrativeDivisionCodes.size>=1">
and province = #{params.administrativeDivisionCodes[0]}
su.delete_flag = 0
<if test="params.name!=null and params.name!=''">
and su.name like concat('%',#{params.name},'%')
</if>
<if test="params.administrativeDivisionCodes.size>=2">
and city = #{params.administrativeDivisionCodes[1]}
<if test="params.socialCode!=null and params.socialCode!=''">
and su.socialCode like concat('%',#{params.socialCode},'%')
</if>
<if test="params.administrativeDivisionCodes.size>=3">
and districts = #{params.administrativeDivisionCodes[2]}
<if test="params.administrativeDivisionCodes!=null">
<if test="params.administrativeDivisionCodes.size>=1">
and su.province = #{params.administrativeDivisionCodes[0]}
</if>
<if test="params.administrativeDivisionCodes.size>=2">
and su.city = #{params.administrativeDivisionCodes[1]}
</if>
<if test="params.administrativeDivisionCodes.size>=3">
and su.districts = #{params.administrativeDivisionCodes[2]}
</if>
<if test="params.administrativeDivisionCodes.size>=4">
and su.street = #{params.administrativeDivisionCodes[3]}
</if>
order by su.create_time desc
</if>
<if test="params.administrativeDivisionCodes.size>=4">
and street = #{params.administrativeDivisionCodes[3]}
</if>
order by create_time desc
</if>
<if test="params.isEnable!=null">and is_enable = #{params.isEnable.value}</if>
<if test="params.checkStatus!=null">and check_status = #{params.checkStatus.value}</if>
<if test="params.isEnable!=null">and su.is_enable = #{params.isEnable.value}</if>
<if test="params.checkStatus!=null">and su.check_status = #{params.checkStatus.value}</if>
order by su.create_time desc
</select>
</mapper>

View File

@ -34,7 +34,10 @@ const columns: TableProps['columns'] = [
title: '印业执照'
}, {
dataIndex: 'legalPersonInfo',
title: '法人信息'
title: '法人信息',
customRender({record}) {
return record.legalPersonInfo?.name + "/" + record.legalPersonInfo?.telephone
},
}, {
dataIndex: 'provinceName',
title: '行政区划',
@ -44,10 +47,12 @@ const columns: TableProps['columns'] = [
title: '性质'
}, {
dataIndex: 'isEnable',
title: '是否启用'
title: '是否启用',
customRender: ({text}) => text?.label,
}, {
dataIndex: 'checkStatus',
title: '审核状态'
title: '审核状态',
customRender: ({text}) => text?.label,
}, {
dataIndex: 'createTime',
title: '创建时间'