添加公安机构和行政区划对应

master
luyya 2024-07-16 18:00:19 +08:00
parent 4259d6badd
commit 8aee7e598d
5 changed files with 233 additions and 13 deletions

View File

@ -0,0 +1,62 @@
package basepro.manager.mapper;
import basepro.manager.pojo.SysDeptXzqh;
import java.util.List;
/**
* Mapper
*
* @author basepro
* @date 2024-07-16
*/
public interface SysDeptXzqhMapper
{
/**
*
*
* @param DeptId ID
* @return
*/
public SysDeptXzqh selectSysDeptXzqhById(String DeptId);
/**
*
*
* @param sysDeptXzqh
* @return
*/
public List<SysDeptXzqh> selectSysDeptXzqhList(SysDeptXzqh sysDeptXzqh);
/**
*
*
* @param sysDeptXzqh
* @return
*/
public int insertSysDeptXzqh(SysDeptXzqh sysDeptXzqh);
/**
*
*
* @param sysDeptXzqh
* @return
*/
public int updateSysDeptXzqh(SysDeptXzqh sysDeptXzqh);
/**
*
*
* @param DeptId ID
* @return
*/
public int deleteSysDeptXzqhById(String DeptId);
/**
*
*
* @param DeptIds ID
* @return
*/
public int deleteSysDeptXzqhByIds(String[] DeptIds);
}

View File

@ -0,0 +1,69 @@
<?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="basepro.manager.mapper.SysDeptXzqhMapper">
<resultMap type="basepro.manager.pojo.SysDeptXzqh" id="SysDeptXzqhResult">
<result property="DeptId" column="dept_id" />
<result property="DeptName" column="dept_name" />
<result property="Xzqhdm" column="xzqhdm" />
<result property="Xzqhmc" column="xzqhmc" />
</resultMap>
<sql id="selectSysDeptXzqhVo">
select dept_id, dept_name, xzqhdm, xzqhmc from sys_dept_xzqh
</sql>
<select id="selectSysDeptXzqhList" parameterType="basepro.manager.pojo.SysDeptXzqh" resultMap="SysDeptXzqhResult">
<include refid="selectSysDeptXzqhVo"/>
<where>
<if test="DeptName != null and DeptName != ''"> and dept_name like concat('%', #{DeptName}, '%')</if>
<if test="Xzqhdm != null and Xzqhdm != ''"> and xzqhdm = #{Xzqhdm}</if>
<if test="Xzqhmc != null and Xzqhmc != ''"> and xzqhmc = #{Xzqhmc}</if>
</where>
</select>
<select id="selectSysDeptXzqhById" parameterType="String" resultMap="SysDeptXzqhResult">
<include refid="selectSysDeptXzqhVo"/>
where dept_id = #{DeptId}
</select>
<insert id="insertSysDeptXzqh" parameterType="basepro.manager.pojo.SysDeptXzqh">
insert into sys_dept_xzqh
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="DeptId != null and DeptId != ''">dept_id,</if>
<if test="DeptName != null and DeptName != ''">dept_name,</if>
<if test="Xzqhdm != null and Xzqhdm != ''">xzqhdm,</if>
<if test="Xzqhmc != null and Xzqhmc != ''">xzqhmc,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="DeptId != null and DeptId != ''">#{DeptId},</if>
<if test="DeptName != null and DeptName != ''">#{DeptName},</if>
<if test="Xzqhdm != null and Xzqhdm != ''">#{Xzqhdm},</if>
<if test="Xzqhmc != null and Xzqhmc != ''">#{Xzqhmc},</if>
</trim>
</insert>
<update id="updateSysDeptXzqh" parameterType="basepro.manager.pojo.SysDeptXzqh">
update sys_dept_xzqh
<trim prefix="SET" suffixOverrides=",">
<if test="DeptName != null and DeptName != ''">dept_name = #{DeptName},</if>
<if test="Xzqhdm != null and Xzqhdm != ''">xzqhdm = #{Xzqhdm},</if>
<if test="Xzqhmc != null and Xzqhmc != ''">xzqhmc = #{Xzqhmc},</if>
</trim>
where dept_id = #{DeptId}
</update>
<delete id="deleteSysDeptXzqhById" parameterType="String">
delete from sys_dept_xzqh where dept_id = #{DeptId}
</delete>
<delete id="deleteSysDeptXzqhByIds" parameterType="String">
delete from sys_dept_xzqh where dept_id in
<foreach item="DeptId" collection="array" open="(" separator="," close=")">
#{DeptId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,80 @@
package basepro.manager.pojo;
import guo.ping.e3mall.common.annotation.Excel;
import guo.ping.e3mall.common.pojo.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_dept_xzqh
*
* @author basepro
* @date 2024-07-16
*/
public class SysDeptXzqh extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 机构ID */
private String DeptId;
/** 机构名称 */
@Excel(name = "机构名称")
private String DeptName;
/** 行政区划代码 */
@Excel(name = "行政区划代码")
private String Xzqhdm;
/** 行政区划名称 */
@Excel(name = "行政区划名称")
private String Xzqhmc;
public void setDeptId(String DeptId)
{
this.DeptId = DeptId;
}
public String getDeptId()
{
return DeptId;
}
public void setDeptName(String DeptName)
{
this.DeptName = DeptName;
}
public String getDeptName()
{
return DeptName;
}
public void setXzqhdm(String Xzqhdm)
{
this.Xzqhdm = Xzqhdm;
}
public String getXzqhdm()
{
return Xzqhdm;
}
public void setXzqhmc(String Xzqhmc)
{
this.Xzqhmc = Xzqhmc;
}
public String getXzqhmc()
{
return Xzqhmc;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("DeptId", getDeptId())
.append("DeptName", getDeptName())
.append("Xzqhdm", getXzqhdm())
.append("Xzqhmc", getXzqhmc())
.toString();
}
}

View File

@ -8,14 +8,8 @@ import java.util.List;
import basepro.manager.common.core.text.Convert; import basepro.manager.common.core.text.Convert;
import basepro.manager.common.utils.DateUtils; import basepro.manager.common.utils.DateUtils;
import basepro.manager.config.DataSourceUtil; import basepro.manager.config.DataSourceUtil;
import basepro.manager.mapper.RoadCheckStatisticsMapper; import basepro.manager.mapper.*;
import basepro.manager.mapper.SysDeptMapper; import basepro.manager.pojo.*;
import basepro.manager.mapper.TbStuckMapper;
import basepro.manager.mapper.TbXjxdzhxxbMapper;
import basepro.manager.pojo.RoadCheckStatistics;
import basepro.manager.pojo.SysDept;
import basepro.manager.pojo.TbStuck;
import basepro.manager.pojo.TbXjxdzhxxb;
import basepro.manager.service.ITbXjxdzhxxbService; import basepro.manager.service.ITbXjxdzhxxbService;
import com.alibaba.dubbo.config.annotation.Service; import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -49,6 +43,9 @@ public class TbXjxdzhxxbServiceImpl implements ITbXjxdzhxxbService
@Autowired @Autowired
private SysDeptMapper deptMapper; private SysDeptMapper deptMapper;
@Autowired
private SysDeptXzqhMapper xzqhMapper;
/** /**
* *
* *
@ -207,6 +204,11 @@ public class TbXjxdzhxxbServiceImpl implements ITbXjxdzhxxbService
xjxd.setGAJGDM(dept.getDeptId()); xjxd.setGAJGDM(dept.getDeptId());
xjxd.setGAJGMC(dept.getShortName()); xjxd.setGAJGMC(dept.getShortName());
} }
SysDeptXzqh xzqh = xzqhMapper.selectSysDeptXzqhById(manageDeptId);
if (null != xzqh){
xjxd.setXZQHDM(xzqh.getXzqhdm());
xjxd.setXZQHMC(xzqh.getXzqhmc());
}
return xjxd; return xjxd;
} }

View File

@ -6,11 +6,18 @@ mybatis:
spring: spring:
datasource: datasource:
username: root druid:
password: 123456 db1:
url: jdbc:mysql://53.1.252.179:8086/TESTDB?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=GMT%2B8 username: root
driver-class-name: com.mysql.jdbc.Driver password: 123456
type: com.alibaba.druid.pool.DruidDataSource jdbc-url: jdbc:mysql://53.1.252.179:8086/TESTDB?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useTimezone=true&serverTimezone=GMT%2B8
driver-class-name: com.mysql.jdbc.Driver
db2:
username: ahrs
password: Ycgis!2509
jdbc-url: jdbc:postgresql://53.1.213.131:25380/st_zazdr?currentSchema=public&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
driver-class-name: org.postgresql.Driver
# type: com.alibaba.druid.pool.DruidDataSource
devtools: devtools:
restart: restart:
enabled: true enabled: true