Browse Source

新增对接市认证部门信息原始数据

v6
Chendy 1 year ago
parent
commit
ee84e7ea65
  1. 484
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SrzDept.java
  2. 41
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/SrzDeptMapper.java
  3. 36
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ISrzDeptService.java
  4. 168
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/SrzDeptServiceImpl.java
  5. 184
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/SrzDeptOriginalDataTask.java
  6. 237
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/SrzDeptMapper.xml

484
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SrzDept.java

@ -0,0 +1,484 @@
package com.zdxt.code.domain;
import com.zdxt.common.BaseDomain;
/**
* 市认证对接---组织机构信息对象 srz_dept
*
* @author ruoyi
* @date 2025-08-06
*/
public class SrzDept extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 机构ID */
private String organizationId;
/** 机构名称 */
private String name;
/** 机构代码 */
private String code;
/** 作用点 */
private String effectOn;
/** 任务ID */
private String taskId;
/** 机构全路径 */
private String zzDisplayPath;
/** 是否叶子节点 */
private String zzIsLeaf;
/** 是否删除 */
private String isDeleted;
/** 是否禁用 */
private String isDisabled;
/** 系统ID */
private String systemId;
/** 机构层级 */
private String zzLevel;
/** 机构父节点 */
private String parentId;
/** 排序 */
private String sequence;
/** 创建时间 */
private String createAt;
/** 更新时间 */
private String updateAt;
/** 下游唯一标识 */
private String guid;
/** 是否驻区机构 */
private String isMappingUnit;
/** 驻区机构上级机构id */
private String mappingUnitParentId;
/** 省认证机构id */
private String srzUnitId;
/** 机构简称 */
private String simpleName;
/** 是否法定机构 */
private String isStatutoryOrg;
/** 是否生效 */
private String isActive;
/** 机构状态代码 */
private String unitStatusCode;
/** 机构状态 */
private String unitStatus;
/** 机构类型 */
private String unitType;
/** 行政区划代码 */
private String xzqhCode;
/** 行政区划 */
private String xzqh;
/** 是否参公管理 */
private String isCGManager;
/** 是否局(委)办 */
private String isBureauOffice;
/** 机构类型代码 */
private String unitTypeCode;
/** 单位性质代码 */
private String dwxzCode;
/** 单位性质 */
private String dwxz;
/** 系统单位类型编码 */
private String unitSysTypeCode;
/** 系统单位类型 */
private String unitSysType;
/** 单位系统类别描述 */
private String dwxtlbms;
/** 机构规格代码 */
private String unitLevelCode;
/** 机构规格 */
private String unitLevel;
/** 统一社会信用代码 */
private String creditcode;
/**
* 描述
*/
private String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setOrganizationId(String organizationId)
{
this.organizationId = organizationId;
}
public String getOrganizationId()
{
return organizationId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setEffectOn(String effectOn)
{
this.effectOn = effectOn;
}
public String getEffectOn()
{
return effectOn;
}
public void setTaskId(String taskId)
{
this.taskId = taskId;
}
public String getTaskId()
{
return taskId;
}
public void setZzDisplayPath(String zzDisplayPath)
{
this.zzDisplayPath = zzDisplayPath;
}
public String getZzDisplayPath()
{
return zzDisplayPath;
}
public void setZzIsLeaf(String zzIsLeaf)
{
this.zzIsLeaf = zzIsLeaf;
}
public String getZzIsLeaf()
{
return zzIsLeaf;
}
public void setIsDeleted(String isDeleted)
{
this.isDeleted = isDeleted;
}
public String getIsDeleted()
{
return isDeleted;
}
public void setIsDisabled(String isDisabled)
{
this.isDisabled = isDisabled;
}
public String getIsDisabled()
{
return isDisabled;
}
public void setSystemId(String systemId)
{
this.systemId = systemId;
}
public String getSystemId()
{
return systemId;
}
public void setZzLevel(String zzLevel)
{
this.zzLevel = zzLevel;
}
public String getZzLevel()
{
return zzLevel;
}
public void setParentId(String parentId)
{
this.parentId = parentId;
}
public String getParentId()
{
return parentId;
}
public void setSequence(String sequence)
{
this.sequence = sequence;
}
public String getSequence()
{
return sequence;
}
public void setCreateAt(String createAt)
{
this.createAt = createAt;
}
public String getCreateAt()
{
return createAt;
}
public void setUpdateAt(String updateAt)
{
this.updateAt = updateAt;
}
public String getUpdateAt()
{
return updateAt;
}
public void setGuid(String guid)
{
this.guid = guid;
}
public String getGuid()
{
return guid;
}
public void setIsMappingUnit(String isMappingUnit)
{
this.isMappingUnit = isMappingUnit;
}
public String getIsMappingUnit()
{
return isMappingUnit;
}
public void setMappingUnitParentId(String mappingUnitParentId)
{
this.mappingUnitParentId = mappingUnitParentId;
}
public String getMappingUnitParentId()
{
return mappingUnitParentId;
}
public void setSrzUnitId(String srzUnitId)
{
this.srzUnitId = srzUnitId;
}
public String getSrzUnitId()
{
return srzUnitId;
}
public void setSimpleName(String simpleName)
{
this.simpleName = simpleName;
}
public String getSimpleName()
{
return simpleName;
}
public void setIsStatutoryOrg(String isStatutoryOrg)
{
this.isStatutoryOrg = isStatutoryOrg;
}
public String getIsStatutoryOrg()
{
return isStatutoryOrg;
}
public void setIsActive(String isActive)
{
this.isActive = isActive;
}
public String getIsActive()
{
return isActive;
}
public void setUnitStatusCode(String unitStatusCode)
{
this.unitStatusCode = unitStatusCode;
}
public String getUnitStatusCode()
{
return unitStatusCode;
}
public void setUnitStatus(String unitStatus)
{
this.unitStatus = unitStatus;
}
public String getUnitStatus()
{
return unitStatus;
}
public void setUnitType(String unitType)
{
this.unitType = unitType;
}
public String getUnitType()
{
return unitType;
}
public void setXzqhCode(String xzqhCode)
{
this.xzqhCode = xzqhCode;
}
public String getXzqhCode()
{
return xzqhCode;
}
public void setXzqh(String xzqh)
{
this.xzqh = xzqh;
}
public String getXzqh()
{
return xzqh;
}
public void setIsCGManager(String isCGManager)
{
this.isCGManager = isCGManager;
}
public String getIsCGManager()
{
return isCGManager;
}
public void setIsBureauOffice(String isBureauOffice)
{
this.isBureauOffice = isBureauOffice;
}
public String getIsBureauOffice()
{
return isBureauOffice;
}
public void setUnitTypeCode(String unitTypeCode)
{
this.unitTypeCode = unitTypeCode;
}
public String getUnitTypeCode()
{
return unitTypeCode;
}
public void setDwxzCode(String dwxzCode)
{
this.dwxzCode = dwxzCode;
}
public String getDwxzCode()
{
return dwxzCode;
}
public void setDwxz(String dwxz)
{
this.dwxz = dwxz;
}
public String getDwxz()
{
return dwxz;
}
public void setUnitSysTypeCode(String unitSysTypeCode)
{
this.unitSysTypeCode = unitSysTypeCode;
}
public String getUnitSysTypeCode()
{
return unitSysTypeCode;
}
public void setUnitSysType(String unitSysType)
{
this.unitSysType = unitSysType;
}
public String getUnitSysType()
{
return unitSysType;
}
public void setDwxtlbms(String dwxtlbms)
{
this.dwxtlbms = dwxtlbms;
}
public String getDwxtlbms()
{
return dwxtlbms;
}
public void setUnitLevelCode(String unitLevelCode)
{
this.unitLevelCode = unitLevelCode;
}
public String getUnitLevelCode()
{
return unitLevelCode;
}
public void setUnitLevel(String unitLevel)
{
this.unitLevel = unitLevel;
}
public String getUnitLevel()
{
return unitLevel;
}
public void setCreditcode(String creditcode)
{
this.creditcode = creditcode;
}
public String getCreditcode()
{
return creditcode;
}
}

41
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/SrzDeptMapper.java

@ -0,0 +1,41 @@
package com.zdxt.code.mapper;
import com.zdxt.code.domain.SrzDept;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 市认证对接---组织机构信息Mapper接口
*
* @author ruoyi
* @date 2025-08-06
*/
@Repository
public interface SrzDeptMapper
{
/**
* 新增市认证对接---组织机构信息
*
* @param srzDept 市认证对接---组织机构信息
* @return 结果
*/
public int insertSrzDept(SrzDept srzDept);
/**
* 修改市认证对接---组织机构信息
*
* @param srzDept 市认证对接---组织机构信息
* @return 结果
*/
public int updateSrzDept(SrzDept srzDept);
/**
* 查询市认证对接---组织机构信息
*
* @param organizationId 市认证对接---组织机构信息ID
* @return 市认证对接---组织机构信息
*/
public SrzDept selectSrzDeptById(String organizationId);
}

36
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ISrzDeptService.java

@ -0,0 +1,36 @@
package com.zdxt.code.service;
import com.alibaba.fastjson.JSONArray;
import com.zdxt.code.domain.SrzDept;
import java.util.Map;
/**
* 市认证对接---组织机构信息Service接口
*
* @author ruoyi
* @date 2025-08-06
*/
public interface ISrzDeptService
{
/**
* 新增市认证对接---组织机构信息
*
* @param srzDept 市认证对接---组织机构信息
* @return 结果
*/
public int insertSrzDept(SrzDept srzDept);
/**
* 修改市认证对接---组织机构信息
*
* @param srzDept 市认证对接---组织机构信息
* @return 结果
*/
public int updateSrzDept(SrzDept srzDept);
public Map<String, Integer> saveSrzDept(JSONArray dataArr, String token);
}

168
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/SrzDeptServiceImpl.java

@ -0,0 +1,168 @@
package com.zdxt.code.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.common.utils.StringUtils;
import com.zdxt.code.domain.SrzDept;
import com.zdxt.code.mapper.SrzDeptMapper;
import com.zdxt.code.service.ISrzDeptService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.security.MessageDigest;
import java.util.Date;
import java.util.Map;
/**
* 市认证对接---组织机构信息Service业务层处理
*
* @author ruoyi
* @date 2025-08-06
*/
@Service
@Slf4j
public class SrzDeptServiceImpl implements ISrzDeptService
{
@Autowired
private SrzDeptMapper srzDeptMapper;
@Value("${srnwg.url}")
private String znwgUrl;
@Value("${srnwg.paasId}")
private String paasId;
@Value("${srnwg.paasToken}")
private String paasToken;
/**
* 新增市认证对接---组织机构信息
*
* @param srzDept 市认证对接---组织机构信息
* @return 结果
*/
@Override
public int insertSrzDept(SrzDept srzDept)
{
return srzDeptMapper.insertSrzDept(srzDept);
}
/**
* 修改市认证对接---组织机构信息
*
* @param srzDept 市认证对接---组织机构信息
* @return 结果
*/
@Override
public int updateSrzDept(SrzDept srzDept)
{
return srzDeptMapper.updateSrzDept(srzDept);
}
@Override
public Map<String, Integer> saveSrzDept(JSONArray dataArr, String token) {
int insertNum = 0;
int updateNum = 0;
for (int i = 0; i < dataArr.size(); i++) {
JSONObject jsonObject = dataArr.getJSONObject(i);
if (StringUtils.isEmpty(jsonObject.getString("organizationId"))) { continue; }
try {
// 返回每条拉取的成功情况
String taskId = jsonObject.getString("taskId");
String params = "{\"token\":\"" + token + "\",\"data\":[{\"taskId\":\"" + taskId + "\",\"result\":\"SUCCESS\"}]}";
String doneStr = connect("/ebus/sfrzhqxglmk/sysDoneTorg", params);
JSONObject doneObj = JSONObject.parseObject(doneStr);
String done = doneObj.getString("success");
log.info("部门拉取完成结果 ========> :{}", done);
} catch (Exception e) {
log.info("部门数据下拉完成异常,异常任务id:{}",jsonObject.getString("taskId"));
e.printStackTrace();
}
SrzDept srzDept=JSONObject.parseObject(jsonObject.toString(),SrzDept.class);
if(srzDept==null)continue;
SrzDept temp = srzDeptMapper.selectSrzDeptById(srzDept.getOrganizationId());
if (null != temp && temp.getOrganizationId() != null) {
// 跟新数据库
int rowNum = srzDeptMapper.updateSrzDept(srzDept);
updateNum += rowNum;
} else {
// 插入数据库
int rowNum = srzDeptMapper.insertSrzDept(srzDept);
insertNum += rowNum;
}
}
Map<String, Integer> resMap = new HashedMap();
resMap.put("insertNum", insertNum);
resMap.put("updateNum", updateNum);
return resMap;
}
private String connect(String apiPath, String params) {
//各种参数
try {
long now = new Date().getTime();
String timestamp = Long.toString((long) Math.floor(now / 1000));
String nonce = Long.toHexString(now) + "-" + Long.toHexString((long) Math.floor(Math.random() * 0xFFFFFF));
String signature = toSHA256(timestamp + paasToken + nonce + timestamp);
//创建CloseableHttpClient
CloseableHttpClient client = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(znwgUrl + apiPath);
httpPost.setHeader("x-tif-paasid", paasId);
httpPost.setHeader("x-tif-timestamp", timestamp);
httpPost.setHeader("x-tif-signature", signature);
httpPost.setHeader("x-tif-nonce", nonce);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Cache-Control", "no-cache");
HttpEntity entity = new StringEntity(params);
httpPost.setEntity(entity);
CloseableHttpResponse response = client.execute(httpPost);
return EntityUtils.toString(response.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private String toSHA256(String str) throws Exception {
MessageDigest messageDigest;
String encodeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes("UTF-8"));
encodeStr = byte2Hex(messageDigest.digest());
} catch (Exception e) {
throw e;
}
return encodeStr;
}
// byte转换成16进制
private String byte2Hex(byte[] bytes) {
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i = 0; i < bytes.length; i++) {
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}

184
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/SrzDeptOriginalDataTask.java

@ -0,0 +1,184 @@
package com.zdxt.code.task;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.project.system.dept.service.IDeptService;
import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.code.service.ISrzDeptService;
import com.zdxt.domain.auth.DictData;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.security.MessageDigest;
import java.util.*;
import java.util.stream.Collectors;
/**
* 市认证组织信息表原始数据对接
*/
@Component("srzDeptOriginalDataTask")
public class SrzDeptOriginalDataTask {
@Value("${srnwg.systemCode}")
private String systemCode;
@Value("${srnwg.integrationKey}")
private String integrationKey;
@Value("${srnwg.url}")
private String znwgUrl;
@Value("${srnwg.paasId}")
private String paasId;
@Value("${srnwg.paasToken}")
private String paasToken;
@Autowired private ISrzDeptService srzDeptService;
@Autowired
private IDictDataService iDictDataService;
public static Map<String,String> params = new HashMap<>();
private static final Logger log = LoggerFactory.getLogger(SrzDeptOriginalDataTask.class);
public void run(){
this.getData();
}
/** 同步部门数据 */
public void getData(){
List<DictData> srz_item = iDictDataService.selectDictDataByType("srz_item");
Map<String,String> map = srz_item.stream().collect(Collectors.toMap(DictData::getDictLabel,DictData::getDictValue));
if(MapUtil.isNotEmpty(map)){
params = map;
}
String token = "";
String destroyTken = "";
try {
// 获取 access_token
String tokenJson = connect("/ebus/sfrzhqxglmk/sysPullLogin?systemCode="+systemCode+"&integrationKey="+integrationKey);
JSONObject tokenObj = JSONObject.parseObject(tokenJson);
System.out.println("====================== access_token ======================");
System.out.println(tokenObj);
System.out.println("====================== access_token ======================");
token = tokenObj.getString("data");
// 获取 用户信息
int page = 0;
int pageSize = 500;
List<Map<String, Integer>> sumMap = new ArrayList<>();
int insertNum = 0;
int updateNum = 0;
page = 0;
// 获取 部门信息
while (true) {
String deptInfoJson = connect("/ebus/sfrzhqxglmk/sysPullOrg?token="+token+"&page="+page+"&pageSize="+pageSize+"&status=0");
JSONObject sourceObj = JSONObject.parseObject(deptInfoJson);
JSONObject tmpJsonObj = sourceObj.getJSONObject("data");
if(null==tmpJsonObj) {
log.info("=====================> tmpJsonObj 为空");
break;
}
JSONArray dataArr = tmpJsonObj.getJSONArray("data");
if (null == dataArr || dataArr.size()==0) { break; }
// 插入更新数据库
log.error("-------------------> 原始组织json: {}", dataArr);
Map<String, Integer> resMap = srzDeptService.saveSrzDept(dataArr,"");
sumMap.add(resMap);
page++;
}
insertNum = 0;
updateNum = 0;
for (Map<String, Integer> item : sumMap) {
insertNum += item.get("insertNum");
updateNum += item.get("updateNum");
}
log.info("新增部门数量 : {} / 更新部门数量 : {}", insertNum, updateNum);
// 注销token
destroyTken = connect("/ebus/sfrzhqxglmk/sysPullLogout?token="+token);
System.out.println("====================== destroyTken ======================");
System.out.println(destroyTken);
System.out.println("====================== destroyTken ======================");
} catch (Exception e) {
e.printStackTrace();
}
}
private String connect(String apiPath) {
//各种参数
try {
String params = ""; //请求接⼝的参数
long now = new Date().getTime();
String timestamp = Long.toString((long) Math.floor(now / 1000));
String nonce = Long.toHexString(now) + "-" + Long.toHexString((long) Math.floor(Math.random() * 0xFFFFFF));
String signature = toSHA256(timestamp + paasToken + nonce + timestamp);
//创建CloseableHttpClient
CloseableHttpClient client = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(znwgUrl + apiPath);
httpPost.setHeader("x-tif-paasid", paasId);
httpPost.setHeader("x-tif-timestamp", timestamp);
httpPost.setHeader("x-tif-signature", signature);
httpPost.setHeader("x-tif-nonce", nonce);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Cache-Control", "no-cache");
HttpEntity entity = new StringEntity(params);
httpPost.setEntity(entity);
CloseableHttpResponse response = client.execute(httpPost);
return EntityUtils.toString(response.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private String toSHA256(String str) throws Exception {
MessageDigest messageDigest;
String encodeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes("UTF-8"));
encodeStr = byte2Hex(messageDigest.digest());
} catch (Exception e) {
throw e;
}
return encodeStr;
}
// byte转换成16进制
private String byte2Hex(byte[] bytes) {
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i = 0; i < bytes.length; i++) {
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}

237
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/SrzDeptMapper.xml

@ -0,0 +1,237 @@
<?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.zdxt.code.mapper.SrzDeptMapper">
<resultMap type="SrzDept" id="SrzDeptResult">
<result property="organizationId" column="organizationId" />
<result property="name" column="name" />
<result property="code" column="code" />
<result property="effectOn" column="effectOn" />
<result property="taskId" column="taskId" />
<result property="zzDisplayPath" column="zzDisplayPath" />
<result property="zzIsLeaf" column="zzIsLeaf" />
<result property="isDeleted" column="isDeleted" />
<result property="isDisabled" column="isDisabled" />
<result property="systemId" column="systemId" />
<result property="zzLevel" column="zzLevel" />
<result property="parentId" column="parentId" />
<result property="sequence" column="sequence" />
<result property="createAt" column="createAt" />
<result property="updateAt" column="updateAt" />
<result property="guid" column="guid" />
<result property="isMappingUnit" column="isMappingUnit" />
<result property="mappingUnitParentId" column="mappingUnitParentId" />
<result property="srzUnitId" column="srzUnitId" />
<result property="simpleName" column="simpleName" />
<result property="isStatutoryOrg" column="isStatutoryOrg" />
<result property="isActive" column="isActive" />
<result property="unitStatusCode" column="unitStatusCode" />
<result property="unitStatus" column="unitStatus" />
<result property="unitType" column="unitType" />
<result property="xzqhCode" column="xzqhCode" />
<result property="xzqh" column="xzqh" />
<result property="isCGManager" column="isCGManager" />
<result property="isBureauOffice" column="isBureauOffice" />
<result property="unitTypeCode" column="unitTypeCode" />
<result property="dwxzCode" column="dwxzCode" />
<result property="dwxz" column="dwxz" />
<result property="unitSysTypeCode" column="unitSysTypeCode" />
<result property="unitSysType" column="unitSysType" />
<result property="dwxtlbms" column="dwxtlbms" />
<result property="unitLevelCode" column="unitLevelCode" />
<result property="unitLevel" column="unitLevel" />
<result property="creditcode" column="creditcode" />
<result property="description" column="description" />
</resultMap>
<sql id="selectSrzDeptVo">
select organizationId, name, code, effectOn, taskId, zzDisplayPath, zzIsLeaf, isDeleted, isDisabled, systemId,
zzLevel, parentId, sequence, createAt, updateAt, guid, isMappingUnit, mappingUnitParentId, srzUnitId,
simpleName, isStatutoryOrg, isActive, unitStatusCode, unitStatus, unitType, xzqhCode, xzqh, isCGManager,
isBureauOffice, unitTypeCode, dwxzCode, dwxz, unitSysTypeCode, unitSysType, dwxtlbms, unitLevelCode,
unitLevel, creditcode,description
from srz_dept
</sql>
<select id="selectSrzDeptList" parameterType="SrzDept" resultMap="SrzDeptResult">
<include refid="selectSrzDeptVo"/>
<where>
<if test="organizationId != null and organizationId != ''"> and organizationId = #{organizationId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="effectOn != null and effectOn != ''"> and effectOn = #{effectOn}</if>
<if test="taskId != null and taskId != ''"> and taskId = #{taskId}</if>
<if test="zzDisplayPath != null and zzDisplayPath != ''"> and zzDisplayPath = #{zzDisplayPath}</if>
<if test="zzIsLeaf != null and zzIsLeaf != ''"> and zzIsLeaf = #{zzIsLeaf}</if>
<if test="isDeleted != null and isDeleted != ''"> and isDeleted = #{isDeleted}</if>
<if test="isDisabled != null and isDisabled != ''"> and isDisabled = #{isDisabled}</if>
<if test="systemId != null and systemId != ''"> and systemId = #{systemId}</if>
<if test="zzLevel != null and zzLevel != ''"> and zzLevel = #{zzLevel}</if>
<if test="parentId != null and parentId != ''"> and parentId = #{parentId}</if>
<if test="sequence != null and sequence != ''"> and sequence = #{sequence}</if>
<if test="createAt != null and createAt != ''"> and createAt = #{createAt}</if>
<if test="updateAt != null and updateAt != ''"> and updateAt = #{updateAt}</if>
<if test="guid != null and guid != ''"> and guid = #{guid}</if>
<if test="isMappingUnit != null and isMappingUnit != ''"> and isMappingUnit = #{isMappingUnit}</if>
<if test="mappingUnitParentId != null and mappingUnitParentId != ''"> and mappingUnitParentId = #{mappingUnitParentId}</if>
<if test="srzUnitId != null and srzUnitId != ''"> and srzUnitId = #{srzUnitId}</if>
<if test="simpleName != null and simpleName != ''"> and simpleName like concat('%', #{simpleName}, '%')</if>
<if test="isStatutoryOrg != null and isStatutoryOrg != ''"> and isStatutoryOrg = #{isStatutoryOrg}</if>
<if test="isActive != null and isActive != ''"> and isActive = #{isActive}</if>
<if test="unitStatusCode != null and unitStatusCode != ''"> and unitStatusCode = #{unitStatusCode}</if>
<if test="unitStatus != null and unitStatus != ''"> and unitStatus = #{unitStatus}</if>
<if test="unitType != null and unitType != ''"> and unitType = #{unitType}</if>
<if test="xzqhCode != null and xzqhCode != ''"> and xzqhCode = #{xzqhCode}</if>
<if test="xzqh != null and xzqh != ''"> and xzqh = #{xzqh}</if>
<if test="isCGManager != null and isCGManager != ''"> and isCGManager = #{isCGManager}</if>
<if test="isBureauOffice != null and isBureauOffice != ''"> and isBureauOffice = #{isBureauOffice}</if>
<if test="unitTypeCode != null and unitTypeCode != ''"> and unitTypeCode = #{unitTypeCode}</if>
<if test="dwxzCode != null and dwxzCode != ''"> and dwxzCode = #{dwxzCode}</if>
<if test="dwxz != null and dwxz != ''"> and dwxz = #{dwxz}</if>
<if test="unitSysTypeCode != null and unitSysTypeCode != ''"> and unitSysTypeCode = #{unitSysTypeCode}</if>
<if test="unitSysType != null and unitSysType != ''"> and unitSysType = #{unitSysType}</if>
<if test="dwxtlbms != null and dwxtlbms != ''"> and dwxtlbms = #{dwxtlbms}</if>
<if test="unitLevelCode != null and unitLevelCode != ''"> and unitLevelCode = #{unitLevelCode}</if>
<if test="unitLevel != null and unitLevel != ''"> and unitLevel = #{unitLevel}</if>
<if test="creditcode != null and creditcode != ''"> and creditcode = #{creditcode}</if>
</where>
</select>
<select id="selectSrzDeptById" parameterType="String" resultMap="SrzDeptResult">
<include refid="selectSrzDeptVo"/>
where organizationId = #{organizationId}
</select>
<insert id="insertSrzDept" parameterType="SrzDept">
insert into srz_dept
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="organizationId != null and organizationId != ''">organizationId,</if>
<if test="name != null and name != ''">name,</if>
<if test="code != null and code != ''">code,</if>
<if test="effectOn != null and effectOn != ''">effectOn,</if>
<if test="taskId != null and taskId != ''">taskId,</if>
<if test="zzDisplayPath != null and zzDisplayPath != ''">zzDisplayPath,</if>
<if test="zzIsLeaf != null and zzIsLeaf != ''">zzIsLeaf,</if>
<if test="isDeleted != null and isDeleted != ''">isDeleted,</if>
<if test="isDisabled != null and isDisabled != ''">isDisabled,</if>
<if test="systemId != null and systemId != ''">systemId,</if>
<if test="zzLevel != null and zzLevel != ''">zzLevel,</if>
<if test="parentId != null and parentId != ''">parentId,</if>
<if test="sequence != null and sequence != ''">sequence,</if>
<if test="createAt != null and createAt != ''">createAt,</if>
<if test="updateAt != null and updateAt != ''">updateAt,</if>
<if test="guid != null and guid != ''">guid,</if>
<if test="isMappingUnit != null and isMappingUnit != ''">isMappingUnit,</if>
<if test="mappingUnitParentId != null and mappingUnitParentId != ''">mappingUnitParentId,</if>
<if test="srzUnitId != null and srzUnitId != ''">srzUnitId,</if>
<if test="simpleName != null and simpleName != ''">simpleName,</if>
<if test="isStatutoryOrg != null and isStatutoryOrg != ''">isStatutoryOrg,</if>
<if test="isActive != null and isActive != ''">isActive,</if>
<if test="unitStatusCode != null and unitStatusCode != ''">unitStatusCode,</if>
<if test="unitStatus != null and unitStatus != ''">unitStatus,</if>
<if test="unitType != null and unitType != ''">unitType,</if>
<if test="xzqhCode != null and xzqhCode != ''">xzqhCode,</if>
<if test="xzqh != null and xzqh != ''">xzqh,</if>
<if test="isCGManager != null and isCGManager != ''">isCGManager,</if>
<if test="isBureauOffice != null and isBureauOffice != ''">isBureauOffice,</if>
<if test="unitTypeCode != null and unitTypeCode != ''">unitTypeCode,</if>
<if test="dwxzCode != null and dwxzCode != ''">dwxzCode,</if>
<if test="dwxz != null and dwxz != ''">dwxz,</if>
<if test="unitSysTypeCode != null and unitSysTypeCode != ''">unitSysTypeCode,</if>
<if test="unitSysType != null and unitSysType != ''">unitSysType,</if>
<if test="dwxtlbms != null and dwxtlbms != ''">dwxtlbms,</if>
<if test="unitLevelCode != null and unitLevelCode != ''">unitLevelCode,</if>
<if test="unitLevel != null and unitLevel != ''">unitLevel,</if>
<if test="creditcode != null and creditcode != ''">creditcode,</if>
<if test="description != null and description != ''">description,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="organizationId != null and organizationId != ''">#{organizationId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="effectOn != null and effectOn != ''">#{effectOn},</if>
<if test="taskId != null and taskId != ''">#{taskId},</if>
<if test="zzDisplayPath != null and zzDisplayPath != ''">#{zzDisplayPath},</if>
<if test="zzIsLeaf != null and zzIsLeaf != ''">#{zzIsLeaf},</if>
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
<if test="isDisabled != null and isDisabled != ''">#{isDisabled},</if>
<if test="systemId != null and systemId != ''">#{systemId},</if>
<if test="zzLevel != null and zzLevel != ''">#{zzLevel},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="sequence != null and sequence != ''">#{sequence},</if>
<if test="createAt != null and createAt != ''">#{createAt},</if>
<if test="updateAt != null and updateAt != ''">#{updateAt},</if>
<if test="guid != null and guid != ''">#{guid},</if>
<if test="isMappingUnit != null and isMappingUnit != ''">#{isMappingUnit},</if>
<if test="mappingUnitParentId != null and mappingUnitParentId != ''">#{mappingUnitParentId},</if>
<if test="srzUnitId != null and srzUnitId != ''">#{srzUnitId},</if>
<if test="simpleName != null and simpleName != ''">#{simpleName},</if>
<if test="isStatutoryOrg != null and isStatutoryOrg != ''">#{isStatutoryOrg},</if>
<if test="isActive != null and isActive != ''">#{isActive},</if>
<if test="unitStatusCode != null and unitStatusCode != ''">#{unitStatusCode},</if>
<if test="unitStatus != null and unitStatus != ''">#{unitStatus},</if>
<if test="unitType != null and unitType != ''">#{unitType},</if>
<if test="xzqhCode != null and xzqhCode != ''">#{xzqhCode},</if>
<if test="xzqh != null and xzqh != ''">#{xzqh},</if>
<if test="isCGManager != null and isCGManager != ''">#{isCGManager},</if>
<if test="isBureauOffice != null and isBureauOffice != ''">#{isBureauOffice},</if>
<if test="unitTypeCode != null and unitTypeCode != ''">#{unitTypeCode},</if>
<if test="dwxzCode != null and dwxzCode != ''">#{dwxzCode},</if>
<if test="dwxz != null and dwxz != ''">#{dwxz},</if>
<if test="unitSysTypeCode != null and unitSysTypeCode != ''">#{unitSysTypeCode},</if>
<if test="unitSysType != null and unitSysType != ''">#{unitSysType},</if>
<if test="dwxtlbms != null and dwxtlbms != ''">#{dwxtlbms},</if>
<if test="unitLevelCode != null and unitLevelCode != ''">#{unitLevelCode},</if>
<if test="unitLevel != null and unitLevel != ''">#{unitLevel},</if>
<if test="creditcode != null and creditcode != ''">#{creditcode},</if>
<if test="description != null and description != ''">#{description},</if>
</trim>
</insert>
<update id="updateSrzDept" parameterType="SrzDept">
update srz_dept
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="code != null and code != ''">code = #{code},</if>
<if test="effectOn != null and effectOn != ''">effectOn = #{effectOn},</if>
<if test="taskId != null and taskId != ''">taskId = #{taskId},</if>
<if test="zzDisplayPath != null and zzDisplayPath != ''">zzDisplayPath = #{zzDisplayPath},</if>
<if test="zzIsLeaf != null and zzIsLeaf != ''">zzIsLeaf = #{zzIsLeaf},</if>
<if test="isDeleted != null and isDeleted != ''">isDeleted = #{isDeleted},</if>
<if test="isDisabled != null and isDisabled != ''">isDisabled = #{isDisabled},</if>
<if test="systemId != null and systemId != ''">systemId = #{systemId},</if>
<if test="zzLevel != null and zzLevel != ''">zzLevel = #{zzLevel},</if>
<if test="parentId != null and parentId != ''">parentId = #{parentId},</if>
<if test="sequence != null and sequence != ''">sequence = #{sequence},</if>
<if test="createAt != null and createAt != ''">createAt = #{createAt},</if>
<if test="updateAt != null and updateAt != ''">updateAt = #{updateAt},</if>
<if test="guid != null and guid != ''">guid = #{guid},</if>
<if test="isMappingUnit != null and isMappingUnit != ''">isMappingUnit = #{isMappingUnit},</if>
<if test="mappingUnitParentId != null and mappingUnitParentId != ''">mappingUnitParentId = #{mappingUnitParentId},</if>
<if test="srzUnitId != null and srzUnitId != ''">srzUnitId = #{srzUnitId},</if>
<if test="simpleName != null and simpleName != ''">simpleName = #{simpleName},</if>
<if test="isStatutoryOrg != null and isStatutoryOrg != ''">isStatutoryOrg = #{isStatutoryOrg},</if>
<if test="isActive != null and isActive != ''">isActive = #{isActive},</if>
<if test="unitStatusCode != null and unitStatusCode != ''">unitStatusCode = #{unitStatusCode},</if>
<if test="unitStatus != null and unitStatus != ''">unitStatus = #{unitStatus},</if>
<if test="unitType != null and unitType != ''">unitType = #{unitType},</if>
<if test="xzqhCode != null and xzqhCode != ''">xzqhCode = #{xzqhCode},</if>
<if test="xzqh != null and xzqh != ''">xzqh = #{xzqh},</if>
<if test="isCGManager != null and isCGManager != ''">isCGManager = #{isCGManager},</if>
<if test="isBureauOffice != null and isBureauOffice != ''">isBureauOffice = #{isBureauOffice},</if>
<if test="unitTypeCode != null and unitTypeCode != ''">unitTypeCode = #{unitTypeCode},</if>
<if test="dwxzCode != null and dwxzCode != ''">dwxzCode = #{dwxzCode},</if>
<if test="dwxz != null and dwxz != ''">dwxz = #{dwxz},</if>
<if test="unitSysTypeCode != null and unitSysTypeCode != ''">unitSysTypeCode = #{unitSysTypeCode},</if>
<if test="unitSysType != null and unitSysType != ''">unitSysType = #{unitSysType},</if>
<if test="dwxtlbms != null and dwxtlbms != ''">dwxtlbms = #{dwxtlbms},</if>
<if test="unitLevelCode != null and unitLevelCode != ''">unitLevelCode = #{unitLevelCode},</if>
<if test="unitLevel != null and unitLevel != ''">unitLevel = #{unitLevel},</if>
<if test="creditcode != null and creditcode != ''">creditcode = #{creditcode},</if>
<if test="description != null and description != ''">description=#{description},</if>
</trim>
where organizationId = #{organizationId}
</update>
</mapper>
Loading…
Cancel
Save