区域代码查询下级
This commit is contained in:
parent
47a1b7747d
commit
a65481f7df
@ -1,15 +0,0 @@
|
||||
package com.xinelu.manage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description 管理端测试类
|
||||
* @Author 纪寒
|
||||
* @Date 2024-02-18 16:28:56
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/testManage")
|
||||
public class ManageTestController {
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.xinelu.manage.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 测试类
|
||||
* @Author 纪寒
|
||||
* @Date 2024-02-18 16:30:07
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ManageTest {
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
}
|
||||
@ -60,12 +60,6 @@ public class SysArea extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty(value = "当前区域所属上级区域编码")
|
||||
private String parentCode;
|
||||
|
||||
/**
|
||||
* 偏远地区标识,0:否,1:是
|
||||
*/
|
||||
@ApiModelProperty(value = "偏远地区标识")
|
||||
private Integer remoteSigns;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
package com.xinelu.manage.mapper;
|
||||
|
||||
/**
|
||||
* @Description 测试mapper
|
||||
* @Author 纪寒
|
||||
* @Date 2024-02-18 16:31:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ManageTestMapper {
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
package com.xinelu.manage.service;
|
||||
|
||||
/**
|
||||
* @Description 测试service接口
|
||||
* @Author 纪寒
|
||||
* @Date 2024-02-18 16:37:41
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ManageTestService {
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
package com.xinelu.manage.service.impl;
|
||||
|
||||
import com.xinelu.manage.service.ManageTestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@ -10,5 +9,5 @@ import org.springframework.stereotype.Service;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class ManageTestServiceImpl implements ManageTestService {
|
||||
public class ManageTestServiceImpl {
|
||||
}
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<?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.xinelu.manage.mapper.ManageTestMapper">
|
||||
</mapper>
|
||||
@ -0,0 +1,164 @@
|
||||
<?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.xinelu.manage.mapper.agencycategory.AgencyCategoryMapper">
|
||||
|
||||
<resultMap type="AgencyCategory" id="AgencyCategoryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="parentCategoryId" column="parent_category_id"/>
|
||||
<result property="categoryName" column="category_name"/>
|
||||
<result property="categoryCode" column="category_code"/>
|
||||
<result property="categoryLevel" column="category_level"/>
|
||||
<result property="categorySort" column="category_sort"/>
|
||||
<result property="categoryRemark" column="category_remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAgencyCategoryVo">
|
||||
select id,
|
||||
parent_category_id,
|
||||
category_name,
|
||||
category_code,
|
||||
category_level,
|
||||
category_sort,
|
||||
category_remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from agency_category
|
||||
</sql>
|
||||
|
||||
<select id="selectAgencyCategoryList" parameterType="AgencyCategory" resultMap="AgencyCategoryResult">
|
||||
<include refid="selectAgencyCategoryVo"/>
|
||||
<where>
|
||||
<if test="parentCategoryId != null ">
|
||||
and parent_category_id = #{parentCategoryId}
|
||||
</if>
|
||||
<if test="categoryName != null and categoryName != ''">
|
||||
and category_name like concat('%', #{categoryName}, '%')
|
||||
</if>
|
||||
<if test="categoryCode != null and categoryCode != ''">
|
||||
and category_code = #{categoryCode}
|
||||
</if>
|
||||
<if test="categoryLevel != null ">
|
||||
and category_level = #{categoryLevel}
|
||||
</if>
|
||||
<if test="categorySort != null ">
|
||||
and category_sort = #{categorySort}
|
||||
</if>
|
||||
<if test="categoryRemark != null and categoryRemark != ''">
|
||||
and category_remark = #{categoryRemark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAgencyCategoryById" parameterType="Long"
|
||||
resultMap="AgencyCategoryResult">
|
||||
<include refid="selectAgencyCategoryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAgencyCategory" parameterType="AgencyCategory" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into agency_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentCategoryId != null">parent_category_id,
|
||||
</if>
|
||||
<if test="categoryName != null">category_name,
|
||||
</if>
|
||||
<if test="categoryCode != null">category_code,
|
||||
</if>
|
||||
<if test="categoryLevel != null">category_level,
|
||||
</if>
|
||||
<if test="categorySort != null">category_sort,
|
||||
</if>
|
||||
<if test="categoryRemark != null">category_remark,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentCategoryId != null">#{parentCategoryId},
|
||||
</if>
|
||||
<if test="categoryName != null">#{categoryName},
|
||||
</if>
|
||||
<if test="categoryCode != null">#{categoryCode},
|
||||
</if>
|
||||
<if test="categoryLevel != null">#{categoryLevel},
|
||||
</if>
|
||||
<if test="categorySort != null">#{categorySort},
|
||||
</if>
|
||||
<if test="categoryRemark != null">#{categoryRemark},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAgencyCategory" parameterType="AgencyCategory">
|
||||
update agency_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentCategoryId != null">parent_category_id =
|
||||
#{parentCategoryId},
|
||||
</if>
|
||||
<if test="categoryName != null">category_name =
|
||||
#{categoryName},
|
||||
</if>
|
||||
<if test="categoryCode != null">category_code =
|
||||
#{categoryCode},
|
||||
</if>
|
||||
<if test="categoryLevel != null">category_level =
|
||||
#{categoryLevel},
|
||||
</if>
|
||||
<if test="categorySort != null">category_sort =
|
||||
#{categorySort},
|
||||
</if>
|
||||
<if test="categoryRemark != null">category_remark =
|
||||
#{categoryRemark},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAgencyCategoryById" parameterType="Long">
|
||||
delete
|
||||
from agency_category
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAgencyCategoryByIds" parameterType="String">
|
||||
delete from agency_category where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,60 @@
|
||||
<?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.xinelu.manage.mapper.sysarea.SysAreaMapper">
|
||||
|
||||
<resultMap type="SysArea" id="SysAreaResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="areaLevel" column="area_level"/>
|
||||
<result property="parentCode" column="parent_code"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysAreaVo">
|
||||
select id,
|
||||
parent_id,
|
||||
area_code,
|
||||
area_name,
|
||||
area_level,
|
||||
parent_code,
|
||||
sort,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from sys_area
|
||||
</sql>
|
||||
|
||||
<select id="selectSysAreaList" parameterType="SysArea" resultMap="SysAreaResult">
|
||||
<include refid="selectSysAreaVo"/>
|
||||
<where>
|
||||
<if test="parentId != null ">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
and area_code = #{areaCode}
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
and area_name like concat( #{areaName}, '%')
|
||||
</if>
|
||||
<if test="parentCode != null and parentCode != ''">
|
||||
and parent_code = #{parentCode}
|
||||
</if>
|
||||
<if test="areaLevel != null ">
|
||||
and area_level = #{areaLevel}
|
||||
</if>
|
||||
<if test="sort != null ">
|
||||
and sort = #{sort}
|
||||
</if>
|
||||
</where>
|
||||
order by sort
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user