用户 企业属地权限调整

This commit is contained in:
韩国东 2022-10-28 15:05:50 +08:00
parent eca366a592
commit f2435a206c
10 changed files with 307 additions and 2885 deletions

View File

@ -1,9 +1,11 @@
package com.rzyc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rzyc.bean.bigdata.AreaInfo;
import com.rzyc.bean.organization.vo.CountByOrg;
import com.rzyc.model.SysOrg;
import com.rzyc.model.SysOrgExample;
import com.rzyc.model.oth.Manual;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -11,7 +13,7 @@ import java.util.List;
import java.util.Map;
@Repository
public interface SysOrgMapper {
public interface SysOrgMapper extends BaseMapper<SysOrg> {
long countByExample(SysOrgExample example);
int deleteByExample(SysOrgExample example);
@ -46,9 +48,14 @@ public interface SysOrgMapper {
/*查询所有*/
List<SysOrg> findAll();
/*用户地区*/
List<SysOrg> findUserArea(@Param("userArea") String userArea);
/*查询所有*/
List<SysOrg> areaPage(@Param("condition") String condition,
@Param("orgcode") String orgcode);
@Param("orgcode") String orgcode,
@Param("userArea") String userArea);
/*修改地区*/
int changeArea(SysOrg record);
@ -84,4 +91,7 @@ public interface SysOrgMapper {
List<SysOrg> checkSysOrg(@Param("superiorOrgCode") String superiorOrgCode,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/*按照等级查询*/
List<SysOrg> findByLevel(@Param("orgLevel") Integer orgLevel);
}

View File

@ -1,5 +1,6 @@
package com.rzyc.mapper.ent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rzyc.bean.bigdata.EntRsikNum;
import com.rzyc.bean.bigdata.FiveEntScore;
import com.rzyc.bean.bigdata.GetSysEnterpriseNum;
@ -19,8 +20,8 @@ import com.rzyc.bean.organization.dto.ManageEnterpriseListDto;
import com.rzyc.bean.organization.vo.AreaEntNum;
import com.rzyc.bean.organization.vo.EnterpriseVo;
import com.rzyc.bean.organization.vo.OrganizationNum;
import com.rzyc.model.SysOrg;
import com.rzyc.model.ent.SysEnterprise;
import com.rzyc.model.ent.SysEnterpriseExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -28,10 +29,8 @@ import java.util.List;
import java.util.Map;
@Repository
public interface SysEnterpriseMapper {
long countByExample(SysEnterpriseExample example);
public interface SysEnterpriseMapper extends BaseMapper<SysEnterprise> {
int deleteByExample(SysEnterpriseExample example);
int deleteByPrimaryKey(String sysenterpriseid);
@ -39,13 +38,10 @@ public interface SysEnterpriseMapper {
int insertSelective(SysEnterprise record);
List<SysEnterprise> selectByExample(SysEnterpriseExample example);
SysEnterprise selectByPrimaryKey(@Param("sysenterpriseid") String sysenterpriseid);
int updateByExampleSelective(@Param("record") SysEnterprise record, @Param("example") SysEnterpriseExample example);
int updateByExample(@Param("record") SysEnterprise record, @Param("example") SysEnterpriseExample example);
int updateByPrimaryKeySelective(SysEnterprise record);

View File

@ -1,5 +1,8 @@
package com.rzyc.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,34 +14,96 @@ import java.util.List;
* @author
*/
@ApiModel("地区列表")
@TableName("sysorg")
public class SysOrg implements Serializable {
@TableId("OrgCode")
@ApiModelProperty("地区编码")
private String orgcode;
@TableField("OrgName")
@ApiModelProperty("地区名")
private String orgname;
@TableField(exist = false)
@ApiModelProperty("父级地区名")
private String superName;
@TableField("charger")
@ApiModelProperty("负责人")
private String charger;
@ApiModelProperty("级别 1 省 2 市 3 区 4 乡镇/街道")
@TableField("OrgLevel")
private Integer orglevel;
@TableField("org_type")
private String orgType;
@ApiModelProperty("父级")
@TableField("SuperiorOrgCode")
private String superiororgcode;
@TableField("CreatedBy")
private String createdby;
@TableField("CreatedOn")
private Date createdon;
@TableField("ModifiedBy")
private String modifiedby;
@TableField("ModifiedOn")
private Date modifiedon;
@ApiModelProperty("经度")
@TableField("lon")
private String lon;
@ApiModelProperty("纬度")
@TableField("lat")
private String lat;
@ApiModelProperty("排序")
@TableField("sort_id")
private String sortId;
@ApiModelProperty("父级级别")
@TableField("parent_path")
private String parentPath;
@ApiModelProperty("父级名称")
@TableField("parent_name")
private String parentName;
@TableField(exist = false)
@ApiModelProperty("子级")
private List<SysOrg> children;
@ApiModelProperty("企业数")
@TableField(exist = false)
private Integer totalEnt;
@ApiModelProperty("检查数")
@TableField(exist = false)
private Integer checkEnt;
public Integer getTotalEnt() {
return totalEnt;
}
public void setTotalEnt(Integer totalEnt) {
this.totalEnt = totalEnt;
}
public Integer getCheckEnt() {
return checkEnt;
}
public void setCheckEnt(Integer checkEnt) {
this.checkEnt = checkEnt;
}
public String getCharger() {
return charger;
}
@ -47,8 +112,45 @@ public class SysOrg implements Serializable {
this.charger = charger;
}
@ApiModelProperty("子级")
private List<SysOrg> children;
public String getLon() {
return lon;
}
public void setLon(String lon) {
this.lon = lon;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getSortId() {
return sortId;
}
public void setSortId(String sortId) {
this.sortId = sortId;
}
public String getParentPath() {
return parentPath;
}
public void setParentPath(String parentPath) {
this.parentPath = parentPath;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
private static final long serialVersionUID = 1L;

View File

@ -1,6 +1,9 @@
package com.rzyc.model.ent;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.common.utils.excel.ExcelColumn;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rzyc.bean.Feature;
@ -18,44 +21,70 @@ import java.util.List;
* @author
*/
@ApiModel("企业表")
@TableName("sysenterprise")
public class SysEnterprise implements Serializable {
@ApiModelProperty("主键")
@TableId("SysEnterpriseId")
private String sysenterpriseid;
@TableField("OrgCode")
@ApiModelProperty("区id")
private String orgcode;
@TableField("street_code")
@ApiModelProperty("街道id")
private String streetCode;
@TableField(exist = false)
@ExcelColumn(value = "街道", col = 3)
private String streetName;
@TableField("community_code")
@ApiModelProperty("社区/村id")
private String communityCode;
@TableField(exist = false)
@ExcelColumn(value = "社区", col = 4)
private String communityName;
@TableField("net_code")
@ApiModelProperty("组/网格id")
private String netCode;
@TableField("area_code")
@ApiModelProperty("地区id")
private String areaCode;
@TableField("area_path")
@ApiModelProperty("地区路径")
private String areaPath;
@TableField("area_name")
@ApiModelProperty("地区名路径")
private String areaName;
@TableField(exist = false)
@ApiModelProperty("经营范围")
private String ManageType;
/**
* 地区名
*/
@TableField(exist = false)
@ExcelColumn(value = "", col = 2)
@ApiModelProperty("")
private String orgName;
@TableField("SuperiorEnterpriseId")
private String superiorenterpriseid;
@TableField("LowOrgCode")
private String loworgcode;
@TableField("EntName")
@ExcelColumn(value = "企业名称", col = 1)
@ApiModelProperty("企业名称")
private String entname;
@ -63,6 +92,7 @@ public class SysEnterprise implements Serializable {
/**
* 经营范围
*/
@TableField("ManageType")
@ApiModelProperty("经营范围")
private String manageType;
@ -71,80 +101,111 @@ public class SysEnterprise implements Serializable {
*/
@ApiModelProperty("静态风险等级 红4 橙3 黄2 蓝1")
@ExcelColumn(value = "静态风险等级 红4 橙3 黄2 蓝1", col = 8)
@TableField("InherentRisk")
private String inherentRisk = RiskLevel.BLUE.getLevel()+"";
/**
* 动态风险等级
*/
@TableField("DynamicRiskLevel")
private String dynamicRiskLevel;
/**
* 标准化等级
*/
@TableField("Complite")
private String complite;
@TableField("EntType")
private String enttype;
@TableField("EntSection")
private String entsection;
/**
* 部门id
*/
@TableField("SysUnitId")
@ApiModelProperty("部门")
private String sysUnitId;
/**
* 主管部门
*/
@TableField("ManagerDept")
@ApiModelProperty("主管部门id")
private String managerDept;
/**
* 主管部门名
*/
@TableField(exist = false)
@ApiModelProperty("主管名称")
private String managerDeptName;
@TableField("BaseSafeClassId")
@ApiModelProperty("涉及安全类别")
private String basesafeclassid;
@TableField("BaseInClassId")
@ApiModelProperty("行业id")
private String baseinclassid;
@TableField("work_class_id")
@ApiModelProperty("最小工作单元行业")
private String workClassId;
@TableField("PinYin")
private String pinyin;
@TableField("Principal")
private String principal;
@TableField("SysAddress")
@ExcelColumn(value = "公司地址", col = 5)
@ApiModelProperty("公司地址")
private String sysaddress;
@TableField("PostCode")
private String postcode;
@TableField("EcoType")
private String ecotype;
@TableField("PersonCount")
private Integer personcount;
@TableField("EntLogoPic")
private String entlogopic;
@TableField("MaleCode")
private String malecode;
@TableField("OrgPassNo")
private String orgpassno;
@TableField("LegalRepre")
@ExcelColumn(value = "企业法人", col = 6)
private String legalrepre;
@TableField("LRIDCard")
private String lridcard;
@TableField("LRLinkTel")
@ExcelColumn(value = "联系方式", col = 7)
private String lrlinktel;
@TableField("EstablishDate")
@ApiModelProperty("成立时间")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date establishdate;
@TableField("RiskLevel")
@ApiModelProperty("动态风险等级")
@ExcelColumn(value = "动态风险等级", col = 9)
private String risklevel = RiskLevel.BLUE.getLevelDesc();
@ -152,128 +213,172 @@ public class SysEnterprise implements Serializable {
/**
* 风险颜色
*/
@TableField(exist = false)
private String risklevelColor;
@TableField("Latitude")
@ApiModelProperty("纬度")
private String latitude;
@TableField("Longitude")
@ApiModelProperty("经度")
private String longitude;
@TableField("IsBlackList")
private String isblacklist;
@TableField("Comments")
private String comments;
@TableField("ISMaleCode")
private String ismalecode;
@TableField("EntScore")
private String entscore;
@TableField("EntHouseNum")
private String enthousenum;
@TableField("CreatedOn")
private Date createdon;
@TableField("CreatedBy")
private String createdby;
@TableField("ModifiedOn")
private Date modifiedon;
@TableField("ModifiedBy")
private String modifiedby;
/**
* 行业名
*/
@TableField(exist = false)
private String industryClassName;
/**
* 顶级行业名
*/
@TableField(exist = false)
private String superClassName;
/**
* 安全类别列表
*/
@TableField(exist = false)
private JSONArray safeClasses;
/**
* 安全类别名
*/
@TableField(exist = false)
private String safeClassName;
/**
*安全管理人员
*/
@TableField("SafeManager")
private String safeManager;
/**
* 安全管理人员联系方式
*/
@TableField("SafeTelephone")
private String safeTelephone;
/**
* 企业状态
*/
@TableField("State")
@ExcelColumn(value = "企业状态", col = 11)
private String state = "启用";
/**
* 是否隐藏
*/
@TableField("IsHide")
@ApiModelProperty("是否隐藏否")
private String isHide = "";
//镇街包片领导
@TableField(exist = false)
private String leaderInfo;
//镇街定点干部
@TableField(exist = false)
private String cadreInfo;
//村社定点干部
@TableField(exist = false)
private String villageInfo;
/**
* 特性字段
*/
@TableField(exist = false)
private List<Feature> features = new LinkedList<>();
/**
* 部门列表
*/
@TableField(exist = false)
private List<ListPerform> units;
@TableField(exist = false)
private String safeIdName;
@TableField(exist = false)
private String inClassName;
//最小工作单元分类
@TableField(exist = false)
@ExcelColumn(value = "企业分类", col = 10)
private String workClassName;
@TableField(exist = false)
private String sysUnitName;
//二维码
@TableField("qr_code")
private String qrCode;
//被选数量
@TableField(exist = false)
private Integer treeNum;
//检查数
@TableField(exist = false)
private Integer checkNum;
/*责任树被选择数量*/
@TableField(exist = false)
private Integer choiceNum;
@TableField(exist = false)
@ApiModelProperty("检查总数")
private Integer checkCount;
@TableField(exist = false)
@ApiModelProperty("隐患总数")
private Integer dangerCount;
@TableField(exist = false)
@ApiModelProperty("已整改")
private Integer rectifiedCount;
@TableField(exist = false)
@ApiModelProperty("整改中")
private Integer rectificationCount;
@TableField(exist = false)
@ApiModelProperty("未整改")
private Integer notRectificationCount;
private static final long serialVersionUID = 1L;
public Integer getCheckCount() {
return checkCount;
@ -315,7 +420,6 @@ public class SysEnterprise implements Serializable {
this.notRectificationCount = notRectificationCount;
}
private static final long serialVersionUID = 1L;
public Integer getChoiceNum() {
return choiceNum;
@ -429,10 +533,6 @@ public class SysEnterprise implements Serializable {
this.qrCode = qrCode;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getSysUnitName() {
return sysUnitName;
}
@ -1010,7 +1110,6 @@ public class SysEnterprise implements Serializable {
sb.append(", createdby=").append(createdby);
sb.append(", modifiedon=").append(modifiedon);
sb.append(", modifiedby=").append(modifiedby);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}

View File

@ -316,6 +316,11 @@
SELECT * FROM SysOrg so
</select>
<!--查询所有-->
<select id="findUserArea" resultMap="BaseResultMap">
SELECT * FROM SysOrg so where FIND_IN_SET(#{userArea},so.parent_path)
</select>
<!--地区列表-->
<resultMap id="AreaResultMap" type="com.rzyc.model.SysOrg">
<id column="OrgCode" jdbcType="VARCHAR" property="orgcode" />
@ -337,6 +342,7 @@
FROM SysOrg so
LEFT JOIN SysOrg sp ON so.`SuperiorOrgCode` = sp.`OrgCode`
WHERE so.`OrgName` LIKE #{condition}
and FIND_IN_SET(#{userArea},so.parent_path)
<if test="null != orgcode and '' !=orgcode ">
and so.`SuperiorOrgCode` = #{orgcode}
</if>
@ -714,4 +720,10 @@ and se.State = '启用'
order by so.OrgCode ASC
</select>
<!--按照等级查询-->
<select id="findByLevel" resultMap="BaseResultMap">
select * from sysorg so
where so.OrgLevel = #{orgLevel}
</select>
</mapper>

View File

@ -57,64 +57,7 @@
<result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
<result column="street_code" jdbcType="VARCHAR" property="streetCode"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
SysEnterpriseId, OrgCode, street_code,community_code,SuperiorEnterpriseId, LowOrgCode,
EntName,
@ -136,28 +79,7 @@
RiskLevel, Latitude, Longitude, IsBlackList, Comments, ISMaleCode, EntScore, EntHouseNum,
CreatedOn, CreatedBy, ModifiedOn, ModifiedBy,qr_code
</sql>
<select id="selectByExample" parameterType="com.rzyc.model.ent.SysEnterpriseExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from SysEnterprise
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
@ -169,12 +91,7 @@
delete from SysEnterprise
where SysEnterpriseId = #{sysenterpriseid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.rzyc.model.ent.SysEnterpriseExample">
delete from SysEnterprise
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.rzyc.model.ent.SysEnterprise">
insert into SysEnterprise (SysEnterpriseId,
@ -510,206 +427,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.rzyc.model.ent.SysEnterpriseExample" resultType="java.lang.Long">
select count(*) from SysEnterprise
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update SysEnterprise
<set>
<if test="record.sysenterpriseid != null">
SysEnterpriseId = #{record.sysenterpriseid,jdbcType=VARCHAR},
</if>
<if test="record.orgcode != null">
OrgCode = #{record.orgcode,jdbcType=VARCHAR},
</if>
<if test="record.superiorenterpriseid != null">
SuperiorEnterpriseId = #{record.superiorenterpriseid,jdbcType=VARCHAR},
</if>
<if test="record.loworgcode != null">
LowOrgCode = #{record.loworgcode,jdbcType=VARCHAR},
</if>
<if test="record.entname != null">
EntName = #{record.entname,jdbcType=VARCHAR},
</if>
<if test="record.isHide != null">
IsHide = #{record.isHide,jdbcType=VARCHAR},
</if>
<if test="record.state != null">
State = #{record.state,jdbcType=VARCHAR},
</if>
<if test="record.complite != null">
complite = #{record.complite,jdbcType=VARCHAR},
</if>
<if test="record.sysUnitId != null">
sysUnitId = #{record.sysUnitId,jdbcType=VARCHAR},
</if>
<if test="record.managerDept != null">
ManagerDept = #{record.managerDept,jdbcType=VARCHAR},
</if>
<if test="record.dynamicRiskLevel != null">
dynamicRiskLevel = #{record.dynamicRiskLevel,jdbcType=VARCHAR},
</if>
<if test="record.inherentRisk != null">
inherentRisk = #{record.inherentRisk,jdbcType=VARCHAR},
</if>
<if test="record.manageType != null">
manageType = #{record.manageType,jdbcType=VARCHAR},
</if>
<if test="record.enttype != null">
EntType = #{record.enttype,jdbcType=VARCHAR},
</if>
<if test="record.entsection != null">
EntSection = #{record.entsection,jdbcType=VARCHAR},
</if>
<if test="record.basesafeclassid != null">
BaseSafeClassId = #{record.basesafeclassid,jdbcType=VARCHAR},
</if>
<if test="record.baseinclassid != null">
BaseInClassId = #{record.baseinclassid,jdbcType=VARCHAR},
</if>
<if test="record.workClassId != null">
work_class_id = #{record.workClassId,jdbcType=VARCHAR},
</if>
<if test="record.pinyin != null">
PinYin = #{record.pinyin,jdbcType=VARCHAR},
</if>
<if test="record.principal != null">
Principal = #{record.principal,jdbcType=VARCHAR},
</if>
<if test="record.sysaddress != null">
SysAddress = #{record.sysaddress,jdbcType=VARCHAR},
</if>
<if test="record.safeTelephone != null">
safeTelephone = #{record.safeTelephone,jdbcType=VARCHAR},
</if>
<if test="record.safeManager != null">
safeManager = #{record.safeManager,jdbcType=VARCHAR},
</if>
<if test="record.postcode != null">
PostCode = #{record.postcode,jdbcType=VARCHAR},
</if>
<if test="record.ecotype != null">
EcoType = #{record.ecotype,jdbcType=VARCHAR},
</if>
<if test="record.personcount != null">
PersonCount = #{record.personcount,jdbcType=INTEGER},
</if>
<if test="record.entlogopic != null">
EntLogoPic = #{record.entlogopic,jdbcType=VARCHAR},
</if>
<if test="record.malecode != null">
MaleCode = #{record.malecode,jdbcType=VARCHAR},
</if>
<if test="record.orgpassno != null">
OrgPassNo = #{record.orgpassno,jdbcType=VARCHAR},
</if>
<if test="record.legalrepre != null">
LegalRepre = #{record.legalrepre,jdbcType=VARCHAR},
</if>
<if test="record.lridcard != null">
LRIDCard = #{record.lridcard,jdbcType=VARCHAR},
</if>
<if test="record.lrlinktel != null">
LRLinkTel = #{record.lrlinktel,jdbcType=VARCHAR},
</if>
<if test="record.establishdate != null">
EstablishDate = #{record.establishdate,jdbcType=TIMESTAMP},
</if>
<if test="record.risklevel != null">
RiskLevel = #{record.risklevel,jdbcType=VARCHAR},
</if>
<if test="record.latitude != null">
Latitude = #{record.latitude,jdbcType=VARCHAR},
</if>
<if test="record.longitude != null">
Longitude = #{record.longitude,jdbcType=VARCHAR},
</if>
<if test="record.isblacklist != null">
IsBlackList = #{record.isblacklist,jdbcType=VARCHAR},
</if>
<if test="record.comments != null">
Comments = #{record.comments,jdbcType=VARCHAR},
</if>
<if test="record.ismalecode != null">
ISMaleCode = #{record.ismalecode,jdbcType=VARCHAR},
</if>
<if test="record.entscore != null">
EntScore = #{record.entscore,jdbcType=VARCHAR},
</if>
<if test="record.enthousenum != null">
EntHouseNum = #{record.enthousenum,jdbcType=VARCHAR},
</if>
<if test="record.createdon != null">
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
</if>
<if test="record.createdby != null">
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
</if>
<if test="record.modifiedon != null">
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="record.modifiedby != null">
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update SysEnterprise
set SysEnterpriseId = #{record.sysenterpriseid,jdbcType=VARCHAR},
OrgCode = #{record.orgcode,jdbcType=VARCHAR},
SuperiorEnterpriseId = #{record.superiorenterpriseid,jdbcType=VARCHAR},
LowOrgCode = #{record.loworgcode,jdbcType=VARCHAR},
EntName = #{record.entname,jdbcType=VARCHAR},
IsHide = #{record.isHide,jdbcType=VARCHAR},
State = #{record.state,jdbcType=VARCHAR},
complite = #{record.complite,jdbcType=VARCHAR},
sysUnitId = #{record.sysUnitId,jdbcType=VARCHAR},
ManagerDept = #{record.managerDept,jdbcType=VARCHAR},
dynamicRiskLevel = #{record.dynamicRiskLevel,jdbcType=VARCHAR},
inherentRisk = #{record.inherentRisk,jdbcType=VARCHAR},
manageType = #{record.manageType,jdbcType=VARCHAR},
EntType = #{record.enttype,jdbcType=VARCHAR},
EntSection = #{record.entsection,jdbcType=VARCHAR},
BaseSafeClassId = #{record.basesafeclassid,jdbcType=VARCHAR},
BaseInClassId = #{record.baseinclassid,jdbcType=VARCHAR},
work_class_id = #{record.workClassId,jdbcType=VARCHAR},
PinYin = #{record.pinyin,jdbcType=VARCHAR},
Principal = #{record.principal,jdbcType=VARCHAR},
SysAddress = #{record.sysaddress,jdbcType=VARCHAR},
safeTelephone = #{record.safeTelephone,jdbcType=VARCHAR},
safeManager = #{record.safeManager,jdbcType=VARCHAR},
PostCode = #{record.postcode,jdbcType=VARCHAR},
EcoType = #{record.ecotype,jdbcType=VARCHAR},
PersonCount = #{record.personcount,jdbcType=INTEGER},
EntLogoPic = #{record.entlogopic,jdbcType=VARCHAR},
MaleCode = #{record.malecode,jdbcType=VARCHAR},
OrgPassNo = #{record.orgpassno,jdbcType=VARCHAR},
LegalRepre = #{record.legalrepre,jdbcType=VARCHAR},
LRIDCard = #{record.lridcard,jdbcType=VARCHAR},
LRLinkTel = #{record.lrlinktel,jdbcType=VARCHAR},
EstablishDate = #{record.establishdate,jdbcType=TIMESTAMP},
RiskLevel = #{record.risklevel,jdbcType=VARCHAR},
Latitude = #{record.latitude,jdbcType=VARCHAR},
Longitude = #{record.longitude,jdbcType=VARCHAR},
IsBlackList = #{record.isblacklist,jdbcType=VARCHAR},
Comments = #{record.comments,jdbcType=VARCHAR},
ISMaleCode = #{record.ismalecode,jdbcType=VARCHAR},
EntScore = #{record.entscore,jdbcType=VARCHAR},
EntHouseNum = #{record.enthousenum,jdbcType=VARCHAR},
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.rzyc.model.ent.SysEnterprise">
update SysEnterprise
<set>
@ -1249,9 +967,9 @@
<!--风险排名-->
<resultMap id="TopfiveResultMap" type="com.rzyc.bean.bigdata.FiveEntScore">
<result column="EntName" jdbcType="VARCHAR" property="EntName" />
<result column="DynamicRiskLevel" jdbcType="VARCHAR" property="DynamicRiskLevel" />
<result column="RiskLevel" jdbcType="VARCHAR" property="RiskLevel" />
<result column="EntName" jdbcType="VARCHAR" property="entName" />
<result column="DynamicRiskLevel" jdbcType="VARCHAR" property="dynamicRiskLevel" />
<result column="RiskLevel" jdbcType="VARCHAR" property="riskLevel" />
</resultMap>
<!--风险排名-->

View File

@ -591,4 +591,52 @@ public class DataController extends com.rzyc.controller.BaseController {
return result;
}
/**
* 地区处理
* @version v1.0
* @author dong
* @date 2022/10/28 10:49
*/
@ApiOperation(value = "地区处理", notes = "地区处理")
@RequestMapping(value = "/orgData", method = RequestMethod.GET)
@ResponseBody
public SingleResult<String> orgData(Integer level)throws Exception{
SingleResult<String> result = new SingleResult<>();
List<SysOrg> sysOrgs = sysOrgMapper.findByLevel(level);
for (SysOrg sysOrg : sysOrgs){
changePath(sysOrg.getOrgcode());
}
return result;
}
/**
* 处理地区信息
* @version v1.0
* @author dong
* @date 2022/10/28 11:01
*/
private void changePath(String orgCode)throws Exception{
SysOrg sysOrg = sysOrgMapper.selectById(orgCode);
if(null != sysOrg){
if(StringUtils.isNotBlank(sysOrg.getSuperiororgcode())){
SysOrg superOrg = sysOrgMapper.selectById(sysOrg.getSuperiororgcode());
if(null != superOrg){
sysOrg.setParentName(superOrg.getParentName()+","+sysOrg.getOrgname());
sysOrg.setParentPath(superOrg.getParentPath()+","+sysOrg.getOrgcode());
}
}else{
sysOrg.setParentName(sysOrg.getOrgname());
sysOrg.setParentPath(sysOrg.getOrgcode());
}
SysOrg org = new SysOrg();
org.setOrgcode(sysOrg.getOrgcode());
org.setParentName(sysOrg.getParentName());
org.setParentPath(sysOrg.getParentPath());
sysOrgMapper.updateById(org);
}
}
}

View File

@ -499,23 +499,21 @@ public class OtherController extends BaseController{
@ResponseBody
public MultiResult<SysOrg> areaTree(String userId)throws Exception{
System.out.println("userId -> "+userId);
MultiResult<SysOrg> result = new MultiResult<>();
List<SysOrg> sysOrgs = new ArrayList<>();
if(StringUtils.isNotBlank(userId)){
SysUser sysUser = sysUserMapper.findById(userId);
if(null != sysUser){
if(StringUtils.isBlank(sysUser.getStreetCode()) && StringUtils.isBlank(sysUser.getCommunityCode())){
sysOrgs = sysOrgMapper.findAll();
}
}else{
sysOrgs = sysOrgMapper.findAll();
}
}else{
sysOrgs = sysOrgMapper.findAll();
//获取用户低
if(StringUtils.isBlank(userId)){
userId = getUserId();
}
//获取用户的地区id
String userArea = getUserArea(userId);
if(StringUtils.isBlank(userArea)){
userArea = constantsConfigure.getSuperiorOrgCode();
}
List<SysOrg> sysOrgs = sysOrgMapper.findUserArea(userArea);
if(sysOrgs.size() > 0){

View File

@ -836,9 +836,11 @@ public class SettingController extends BaseController{
public SingleResult<Pager<SysOrg>> areaPage(@Valid AreaPageDto areaPageDto)throws Exception{
SingleResult<Pager<SysOrg>> result = new SingleResult<>();
String condition = TypeConversion.getCondition(areaPageDto.getCondition());
String userId = getUserId();
String userArea = getUserArea(userId);
//分页
PageHelper.startPage(areaPageDto.getPage(), areaPageDto.getPageSize());
Page<SysOrg> page = (Page<SysOrg>)sysOrgMapper.areaPage(condition,areaPageDto.getOrgcode());
Page<SysOrg> page = (Page<SysOrg>)sysOrgMapper.areaPage(condition,areaPageDto.getOrgcode(),userArea);
Pager<SysOrg> pager = new Pager<>();
getDatePage(pager,page);
result.setData(pager);