查询项目的行政区域信息接口,项目相关管理接口逻辑完善,行政区划管理相关接口逻辑完善
This commit is contained in:
@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
|
||||
@ -11,7 +13,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
* 项目对象 project
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-18
|
||||
* @date 2024-10-25
|
||||
*/
|
||||
@ApiModel(value = "Project",description = "项目 project")
|
||||
@Data
|
||||
@ -121,9 +123,34 @@ public class Project extends BaseEntity
|
||||
@ApiModelProperty("项目所属机构名称")
|
||||
private String deptName;
|
||||
|
||||
/** 项目级别:市,县 */
|
||||
@Excel(name = "项目级别:市,县")
|
||||
@ApiModelProperty("项目级别:市,县")
|
||||
/** 项目级别:1市级2县级 */
|
||||
@Excel(name = "项目级别:1市级2县级")
|
||||
@ApiModelProperty("项目级别:1市级2县级")
|
||||
private String level;
|
||||
|
||||
/** 行政区域省代码 */
|
||||
@Excel(name = "行政区域省代码")
|
||||
@ApiModelProperty("行政区域省代码")
|
||||
private String provinceCode;
|
||||
|
||||
/** 行政区域市代码 */
|
||||
@Excel(name = "行政区域市代码")
|
||||
@ApiModelProperty("行政区域市代码")
|
||||
private String cityCode;
|
||||
|
||||
/** 行政区域县代码 */
|
||||
@Excel(name = "行政区域县代码")
|
||||
@ApiModelProperty("行政区域县代码")
|
||||
private String countyCode;
|
||||
|
||||
/** 行政区域镇代码 */
|
||||
@Excel(name = "行政区域镇代码")
|
||||
@ApiModelProperty("行政区域镇代码")
|
||||
private String townCode;
|
||||
|
||||
/** 行政区域村代码 */
|
||||
@Excel(name = "行政区域村代码")
|
||||
@ApiModelProperty("行政区域村代码")
|
||||
private String villageCode;
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public interface ProjectMapper extends MPJBaseMapper<Project>
|
||||
* @param projectId 项目主键
|
||||
* @return 项目
|
||||
*/
|
||||
Project selectProjectByProjectId(Long projectId);
|
||||
Project selectProjectById(Long projectId);
|
||||
|
||||
/**
|
||||
* 查询项目列表
|
||||
|
@ -2,6 +2,7 @@ package com.fastbee.project.service;
|
||||
|
||||
import com.fastbee.common.core.domain.entity.SysDept;
|
||||
import com.fastbee.project.domain.Project;
|
||||
import com.fastbee.system.domain.SysDistrict;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -73,4 +74,9 @@ public interface IProjectService
|
||||
*/
|
||||
List<Project> selectAdminProjectList();
|
||||
|
||||
/**
|
||||
* 获取项目行政区域列表
|
||||
* @return 行政区域列表
|
||||
*/
|
||||
List<SysDistrict> getProjectAreaTree(Long projectId,Integer reachLevel);
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.fastbee.project.service.impl;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONException;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.fastbee.common.constant.ProjectLevelConstant;
|
||||
import com.fastbee.common.core.domain.entity.SysDept;
|
||||
@ -12,12 +15,15 @@ import com.fastbee.project.domain.Project;
|
||||
import com.fastbee.project.mapper.ProjectMapper;
|
||||
import com.fastbee.project.service.IProjectService;
|
||||
|
||||
import com.fastbee.system.domain.SysDistrict;
|
||||
import com.fastbee.system.mapper.SysDeptMapper;
|
||||
import com.fastbee.system.mapper.SysDistrictMapper;
|
||||
import com.fastbee.system.mapper.SysUserMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 项目Service业务层处理
|
||||
@ -33,10 +39,13 @@ public class ProjectServiceImpl implements IProjectService
|
||||
private final SysDeptMapper sysDeptMapper;
|
||||
private final SysUserMapper sysUserMapper;
|
||||
|
||||
public ProjectServiceImpl(ProjectMapper projectMapper, SysDeptMapper sysDeptMapper, SysUserMapper sysUserMapper) {
|
||||
private final SysDistrictMapper sysDistrictMapper;
|
||||
|
||||
public ProjectServiceImpl(ProjectMapper projectMapper, SysDeptMapper sysDeptMapper, SysUserMapper sysUserMapper, SysDistrictMapper sysDistrictMapper) {
|
||||
this.projectMapper = projectMapper;
|
||||
this.sysDeptMapper = sysDeptMapper;
|
||||
this.sysUserMapper = sysUserMapper;
|
||||
this.sysDistrictMapper = sysDistrictMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -48,7 +57,7 @@ public class ProjectServiceImpl implements IProjectService
|
||||
@Override
|
||||
public Project selectProjectByProjectId(Long projectId)
|
||||
{
|
||||
return projectMapper.selectProjectByProjectId(projectId);
|
||||
return projectMapper.selectProjectById(projectId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,9 +68,10 @@ public class ProjectServiceImpl implements IProjectService
|
||||
{
|
||||
return new LambdaQueryChainWrapper<>(projectMapper)
|
||||
.select(Project::getId, Project::getProjectName, Project::getScope,
|
||||
Project::getAdministrativeArea, Project::getDeptId,Project::getAdministrativeAreaCode,
|
||||
Project::getDeptId,
|
||||
Project::getLogo, Project::getImage, Project::getLevel, Project::getDeptName,
|
||||
Project::getCreateTime)
|
||||
Project::getCreateTime,
|
||||
Project::getAdministrativeAreaCode,Project::getAdministrativeArea, Project::getProvinceCode,Project::getCityCode,Project::getCountyCode)
|
||||
.like(StringUtils.isNotBlank(project.getSearchValue()),Project::getProjectName, project.getSearchValue())
|
||||
.list();
|
||||
}
|
||||
@ -72,16 +82,76 @@ public class ProjectServiceImpl implements IProjectService
|
||||
@Override
|
||||
public int insertProject(Project project)
|
||||
{ //判断选择的机构下是否已经绑定项目
|
||||
List<Project> projectList = new LambdaQueryChainWrapper<>(projectMapper)
|
||||
.select(Project::getId, Project::getProjectName)
|
||||
.eq(Project::getDeptId, project.getDeptId()).list();
|
||||
if(!projectList.isEmpty()){
|
||||
throw new ServiceException("该机构下已经存在项目");
|
||||
// List<Project> projectList = new LambdaQueryChainWrapper<>(projectMapper)
|
||||
// .select(Project::getId, Project::getProjectName)
|
||||
// .eq(Project::getDeptId, project.getDeptId()).list();
|
||||
// if(!projectList.isEmpty()){
|
||||
// throw new ServiceException("该机构下已经存在项目");
|
||||
// }
|
||||
//项目行政区域处理
|
||||
//拆解项目行政区域代码信息
|
||||
if(StringUtils.isBlank(project.getAdministrativeAreaCode())){
|
||||
throw new ServiceException("项目行政区域代码不能为空!");
|
||||
}
|
||||
//判断行政区域代码json格式
|
||||
if(isNotValidJsonArray(project.getAdministrativeAreaCode())){
|
||||
throw new ServiceException("项目行政区域代码多选列表非json数组!");
|
||||
}
|
||||
//项目省代码列表
|
||||
List<String> provincialCodeList =new ArrayList<>();
|
||||
//项目市代码列表
|
||||
List<String> cityCodeList =new ArrayList<>();
|
||||
//项目县代码列表
|
||||
List<String> countyCodeList =new ArrayList<>();
|
||||
//项目镇代码列表
|
||||
List<String> townCodeList =new ArrayList<>();
|
||||
//项目村代码列表
|
||||
List<String> villageCodeList =new ArrayList<>();
|
||||
JSONArray administrativeAreaList = JSONUtil.parseArray(project.getAdministrativeAreaCode());
|
||||
administrativeAreaList.forEach(item->{
|
||||
if(isNotValidJsonArray(item.toString())){
|
||||
throw new ServiceException("项目行政区域代码多选列表的元素非json数组!");
|
||||
}
|
||||
//单个行政区划代码列表
|
||||
JSONArray administrativeArea = JSONUtil.parseArray(item);
|
||||
//拆解出每个行政区划代码里面的镇或村
|
||||
if(administrativeArea.size()!=5){
|
||||
throw new ServiceException("项目行政区域代码多选列表的元素长度必须为5,到达村级别!");
|
||||
}
|
||||
//保存项目省代码列表
|
||||
provincialCodeList.add(administrativeArea.get(0).toString());
|
||||
//保存项目市代码列表
|
||||
cityCodeList.add(administrativeArea.get(1).toString());
|
||||
//保存项目县代码列表
|
||||
countyCodeList.add(administrativeArea.get(2).toString());
|
||||
//保存项目镇代码列表
|
||||
townCodeList.add(administrativeArea.get(3).toString());
|
||||
//保存项目村代码列表
|
||||
villageCodeList.add(administrativeArea.get(4).toString());
|
||||
});
|
||||
|
||||
//设置项目省、市、县、镇、村行政区划代码列表
|
||||
project.setProvinceCode(JSONUtil.toJsonStr(provincialCodeList));
|
||||
project.setCityCode(JSONUtil.toJsonStr(cityCodeList));
|
||||
project.setCountyCode(JSONUtil.toJsonStr(countyCodeList));
|
||||
project.setTownCode(JSONUtil.toJsonStr(townCodeList));
|
||||
project.setVillageCode(JSONUtil.toJsonStr(villageCodeList));
|
||||
project.setCreateTime(DateUtils.getNowDate());
|
||||
return projectMapper.insertProject(project);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证json对象是否是数组
|
||||
*/
|
||||
public boolean isNotValidJsonArray(String jsonStr) {
|
||||
try {
|
||||
JSONUtil.parseArray(jsonStr);
|
||||
} catch (JSONException e) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目
|
||||
*/
|
||||
@ -186,11 +256,154 @@ public class ProjectServiceImpl implements IProjectService
|
||||
//查询所有子一级项目列表
|
||||
projectList = new LambdaQueryChainWrapper<>(projectMapper)
|
||||
.select(Project::getId, Project::getProjectName)
|
||||
.in(!ProjectHolder.getProjectInfo().getProjectIdList().isEmpty(),Project::getParentId, ProjectHolder.getProjectInfo().getProjectIdList())
|
||||
.in(!ProjectHolder.getProjectInfo().getProjectIdList().isEmpty(),Project::getParentId,
|
||||
ProjectHolder.getProjectInfo().getProjectIdList())
|
||||
.list();
|
||||
}
|
||||
return projectList;
|
||||
}
|
||||
/**
|
||||
* 查询项目的行政区划树状列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysDistrict> getProjectAreaTree(Long projectId,Integer startLevel) {
|
||||
//参数校验
|
||||
if(startLevel>5||startLevel<1){
|
||||
throw new ServiceException("超出行政级别查询范围(1~5级)!");
|
||||
}
|
||||
//查询项目的行政区划信息
|
||||
Project project = new LambdaQueryChainWrapper<>(projectMapper)
|
||||
.select(Project::getProvinceCode, Project::getCityCode, Project::getCountyCode,
|
||||
Project::getTownCode, Project::getVillageCode)
|
||||
.eq(Project::getId, projectId)
|
||||
.one();
|
||||
if (Objects.isNull(project)) {
|
||||
throw new ServiceException("项目不存在");
|
||||
}
|
||||
//判断项目的省、市、县、镇、村行政区划列表数据不为null
|
||||
isProvinceCodeBlank(project);
|
||||
|
||||
//查询项目的省、市、县、镇、村行政区划列表数据
|
||||
//目前项目下面的镇或者村都可以多选划分成一个项目
|
||||
//找到项目行政区划开始多选的级别
|
||||
//判断省是否多选
|
||||
JSONArray provinceCodeList = JSONUtil.parseArray(project.getProvinceCode());
|
||||
//判断集合中的元素值都相等则说明省未多选
|
||||
if (!provinceCodeList.stream().allMatch(provinceCode -> provinceCode.equals(provinceCodeList.get(0)))) {
|
||||
throw new ServiceException("项目省级行政区划只能包含一个省!");
|
||||
}
|
||||
|
||||
//判断市是否多选
|
||||
JSONArray cityCodeList = JSONUtil.parseArray(project.getCityCode());
|
||||
//判断集合中的元素值都相等则说明市未多选
|
||||
if (!cityCodeList.stream().allMatch(cityCode -> cityCode.equals(cityCodeList.get(0)))) {
|
||||
throw new ServiceException("项目市级行政区划只能包含一个市!");
|
||||
}
|
||||
//判断县是否多选
|
||||
JSONArray countyCodeList = JSONUtil.parseArray(project.getCountyCode());
|
||||
//判断集合中的元素值都相等则说明县未多选
|
||||
if (!countyCodeList.stream().allMatch(countyCode -> countyCode.equals(countyCodeList.get(0)))) {
|
||||
throw new ServiceException("项目县级行政区划只能包含一个县!");
|
||||
}
|
||||
//判断镇是否多选
|
||||
JSONArray townCodeList = JSONUtil.parseArray(project.getTownCode());
|
||||
//判断集合中的元素值都相等则说明镇未多选
|
||||
List<Object> distinctTownCodeList = new ArrayList<>();
|
||||
// if (!townCodeList.stream().allMatch(townCode -> townCode.equals(townCodeList.get(0)))) {
|
||||
//找出选择了哪些镇,给元素去重
|
||||
distinctTownCodeList = townCodeList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
// }
|
||||
|
||||
JSONArray villageCodeList = JSONUtil.parseArray(project.getVillageCode());
|
||||
|
||||
System.err.println("镇行政区划代码");
|
||||
System.err.println(distinctTownCodeList);
|
||||
System.err.println("村行政区划代码");
|
||||
System.err.println(villageCodeList);
|
||||
//合并镇、村行政区划代码集合
|
||||
List<Object> townAndvillageCodeList = new ArrayList<>();
|
||||
townAndvillageCodeList.addAll(distinctTownCodeList);
|
||||
townAndvillageCodeList.addAll(villageCodeList);
|
||||
System.err.println("合并后镇、村行政区划代码");
|
||||
System.err.println(townAndvillageCodeList);
|
||||
|
||||
//查询项目所属县下面的所有镇、村行政区划列表
|
||||
List<SysDistrict> projectDistrictList =new ArrayList<>();
|
||||
LambdaQueryChainWrapper<SysDistrict> sysDistrictLambdaQueryChainWrapper = new LambdaQueryChainWrapper<>(sysDistrictMapper)
|
||||
.select(SysDistrict::getId, SysDistrict::getParentId, SysDistrict::getName, SysDistrict::getAdcode,
|
||||
SysDistrict::getLevel, SysDistrict::getFullName, SysDistrict::getName
|
||||
, SysDistrict::getLng, SysDistrict::getLat);
|
||||
// List<Integer> administrativeDivisionLevelList=new ArrayList<>();
|
||||
// //倒叙循环reachLevel次
|
||||
// for (int i = startLevel;i<6; i++) {
|
||||
// administrativeDivisionLevelList.add(i);
|
||||
// }
|
||||
//限制行政区划级别
|
||||
projectDistrictList = sysDistrictLambdaQueryChainWrapper
|
||||
// .in(SysDistrict::getLevel, administrativeDivisionLevelList)
|
||||
|
||||
// .eq(SysDistrict::getParentId, countyCodeList.get(0))
|
||||
// .in(SysDistrict::getAdcode,townAndvillageCodeList)
|
||||
.list();
|
||||
//过滤掉非项目行政区划的省份数据
|
||||
projectDistrictList = projectDistrictList.stream().
|
||||
filter(sysDistrict -> (
|
||||
sysDistrict.getAdcode().toString().equals(provinceCodeList.get(0).toString())
|
||||
&& sysDistrict.getParentId()==null
|
||||
// ||!sysDistrict.getAdcode().equals(cityCodeList.get(0))
|
||||
// ||!sysDistrict.getAdcode().equals(countyCodeList.get(0))
|
||||
)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
System.err.println("项目所属县下面的所有镇、村行政区划列表");
|
||||
System.err.println(projectDistrictList);
|
||||
//构建树状结构
|
||||
return buildTree(projectDistrictList);
|
||||
}
|
||||
|
||||
private static void isProvinceCodeBlank(Project project) {
|
||||
if (StringUtils.isBlank(project.getProvinceCode())){
|
||||
throw new ServiceException("项目省级行政区划信息缺失!");
|
||||
}
|
||||
if (StringUtils.isBlank(project.getCityCode())){
|
||||
throw new ServiceException("项目市级行政区划信息缺失!");
|
||||
}
|
||||
if (StringUtils.isBlank(project.getCountyCode())){
|
||||
throw new ServiceException("项目县级行政区划信息缺失!");
|
||||
}
|
||||
if (StringUtils.isBlank(project.getTownCode())){
|
||||
throw new ServiceException("项目镇级行政区划信息缺失!");
|
||||
}
|
||||
if (StringUtils.isBlank(project.getVillageCode())){
|
||||
throw new ServiceException("项目村级行政区划信息缺失!");
|
||||
}
|
||||
}
|
||||
|
||||
private List<SysDistrict> buildTree(List<SysDistrict> SysDistricts) {
|
||||
Map<Long, SysDistrict> map = new HashMap<>();
|
||||
List<SysDistrict> roots = new ArrayList<>();
|
||||
for (SysDistrict sysDistrict : SysDistricts) {
|
||||
map.put(sysDistrict.getAdcode(), sysDistrict);
|
||||
}
|
||||
return getDistricts(SysDistricts, map, roots);
|
||||
}
|
||||
|
||||
private List<SysDistrict> getDistricts(List<SysDistrict> SysDistricts, Map<Long, SysDistrict> map, List<SysDistrict> roots) {
|
||||
for (SysDistrict sysDistrict : SysDistricts) {
|
||||
Long parentId = sysDistrict.getParentId();
|
||||
if (parentId == null || !map.containsKey(parentId)) {
|
||||
roots.add(sysDistrict);
|
||||
} else {
|
||||
SysDistrict parent = map.get(parentId);
|
||||
if (parent.getChildren() == null) {
|
||||
parent.setChildren(new ArrayList<>());
|
||||
}
|
||||
parent.getChildren().add(sysDistrict);
|
||||
}
|
||||
}
|
||||
return roots;
|
||||
}
|
||||
|
||||
public List<Long> getAllProjects(Long projectId) {
|
||||
List<Long> allProjects = new ArrayList<>();
|
||||
|
@ -31,10 +31,15 @@
|
||||
<result property="administrativeAreaCode" column="administrative_area_code" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="level" column="level" />
|
||||
<result property="provinceCode" column="province_code" />
|
||||
<result property="cityCode" column="city_code" />
|
||||
<result property="countyCode" column="county_code" />
|
||||
<result property="townCode" column="town_code" />
|
||||
<result property="villageCode" column="village_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProjectVo">
|
||||
select id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id, dept_id, administrative_area_code, dept_name, level from project
|
||||
select id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name, owner_id, parent_id, dept_id, administrative_area_code, dept_name, level, province_code, city_code, county_code, town_code, village_code from project
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
|
||||
@ -60,18 +65,22 @@
|
||||
<if test="administrativeAreaCode != null and administrativeAreaCode != ''"> and administrative_area_code = #{administrativeAreaCode}</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="level != null and level != ''"> and level = #{level}</if>
|
||||
<if test="provinceCode != null and provinceCode != ''"> and province_code = #{provinceCode}</if>
|
||||
<if test="cityCode != null and cityCode != ''"> and city_code = #{cityCode}</if>
|
||||
<if test="countyCode != null and countyCode != ''"> and county_code = #{countyCode}</if>
|
||||
<if test="townCode != null and townCode != ''"> and town_code = #{townCode}</if>
|
||||
<if test="villageCode != null and villageCode != ''"> and village_code = #{villageCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectByProjectId" parameterType="Long" resultMap="ProjectResult">
|
||||
<select id="selectProjectById" parameterType="Long" resultMap="ProjectResult">
|
||||
<include refid="selectProjectVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProject" parameterType="Project">
|
||||
<insert id="insertProject" parameterType="Project" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="projectName != null and projectName != ''">project_name,</if>
|
||||
<if test="sysShowName != null and sysShowName != ''">sys_show_name,</if>
|
||||
<if test="centralCoordinates != null and centralCoordinates != ''">central_coordinates,</if>
|
||||
@ -97,9 +106,13 @@
|
||||
<if test="administrativeAreaCode != null">administrative_area_code,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="provinceCode != null">province_code,</if>
|
||||
<if test="cityCode != null">city_code,</if>
|
||||
<if test="countyCode != null">county_code,</if>
|
||||
<if test="townCode != null">town_code,</if>
|
||||
<if test="villageCode != null">village_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="projectName != null and projectName != ''">#{projectName},</if>
|
||||
<if test="sysShowName != null and sysShowName != ''">#{sysShowName},</if>
|
||||
<if test="centralCoordinates != null and centralCoordinates != ''">#{centralCoordinates},</if>
|
||||
@ -125,6 +138,11 @@
|
||||
<if test="administrativeAreaCode != null">#{administrativeAreaCode},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="provinceCode != null">#{provinceCode},</if>
|
||||
<if test="cityCode != null">#{cityCode},</if>
|
||||
<if test="countyCode != null">#{countyCode},</if>
|
||||
<if test="townCode != null">#{townCode},</if>
|
||||
<if test="villageCode != null">#{villageCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -156,17 +174,22 @@
|
||||
<if test="administrativeAreaCode != null">administrative_area_code = #{administrativeAreaCode},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
<if test="provinceCode != null">province_code = #{provinceCode},</if>
|
||||
<if test="cityCode != null">city_code = #{cityCode},</if>
|
||||
<if test="countyCode != null">county_code = #{countyCode},</if>
|
||||
<if test="townCode != null">town_code = #{townCode},</if>
|
||||
<if test="villageCode != null">village_code = #{villageCode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProjectByProjectId" parameterType="Long">
|
||||
<delete id="deleteProjectById" parameterType="Long">
|
||||
delete from project where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProjectByProjectIds" parameterType="String">
|
||||
<delete id="deleteProjectByIds" parameterType="String">
|
||||
delete from project where id in
|
||||
<foreach item="projectId" collection="array" open="(" separator="," close=")">
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
Reference in New Issue
Block a user