Merge pull request 'lvleigang' (#40) from lvleigang into dev

Reviewed-on: http://hzya.ufyct.com:9015/root/kangarooDataCenterV3/pulls/40
This commit is contained in:
13758950345 2024-06-17 10:34:22 +08:00
commit a7c2f0b8cb
60 changed files with 4545 additions and 4651 deletions

View File

@ -73,7 +73,6 @@ public interface IBaseDao<E extends Serializable, PK extends Serializable> {
* @return
*/
int delete(String paramString, Object paramObject);
/**
* 修改
* @param paramString sqlMapperID
@ -178,6 +177,8 @@ public interface IBaseDao<E extends Serializable, PK extends Serializable> {
*/
Integer getCount(E paramE);
Integer getCount(String statement,Object baseEntity);
/**
* 分页查询
* @param paramString mapperID

View File

@ -276,6 +276,11 @@ public abstract class MybatisGenericDao<E extends Serializable, PK extends Seria
return list;
}
@Override
public Integer getCount(String statement,Object baseEntity) {
Integer totalCount = this.sqlSession.selectOne(statement, baseEntity);
return totalCount;
}
public List<E> query(Object baseEntity) {
Assert.notNull(baseEntity, "query baseEntity :不能为NULL");

View File

@ -2,6 +2,7 @@ package com.hzya.frame.mdm.entity;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import java.util.List;
@ -12,6 +13,8 @@ public class MdmDto {
private Long mdmCode;
//单据编码规则
private List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList;
//字段规则
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities;
//主数据主表
private MdmModuleDbEntity mainMdmModuleDb;
//主数据子表
@ -20,6 +23,10 @@ public class MdmDto {
//id
private String id;
//id
private String fieldId;
//id
private String dbId;
//3新增4修改 5查看
private String showType;
//分页
@ -201,5 +208,29 @@ public class MdmDto {
public void setUpId(String upId) {
this.upId = upId;
}
public List<MdmModuleDbFiledsRuleEntity> getMdmModuleDbFiledsRuleEntities() {
return mdmModuleDbFiledsRuleEntities;
}
public void setMdmModuleDbFiledsRuleEntities(List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities) {
this.mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleEntities;
}
public String getFieldId() {
return fieldId;
}
public void setFieldId(String fieldId) {
this.fieldId = fieldId;
}
public String getDbId() {
return dbId;
}
public void setDbId(String dbId) {
this.dbId = dbId;
}
}

View File

@ -9,6 +9,10 @@ import java.util.List;
public class MdmModuleViewVo {
/** 主数据模版ID */
private String mdmId;
/** 类型1、查询2、列表3、新增4、修改 5、查看 */
private String viewType;
//模版
private MdmModuleViewEntity mdmModuleViewEntity;
//新增
@ -131,6 +135,20 @@ public class MdmModuleViewVo {
this.dbButtonFiled = dbButtonFiled;
}
public String getMdmId() {
return mdmId;
}
public void setMdmId(String mdmId) {
this.mdmId = mdmId;
}
public String getViewType() {
return viewType;
}
public void setViewType(String viewType) {
this.viewType = viewType;
}
}

View File

@ -5,6 +5,7 @@ import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.sys.entity.FormmainDeleteDto;
import java.util.HashMap;
@ -26,6 +27,7 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
Integer checkTable(Map<String, String> maps);
Integer createTable(Map<String, Object> maps);
Integer alterTable(Map<String, Object> maps);
Integer alterTableField(MdmModuleDbFiledsEntity entity);
Integer alterTableName(Map<String, String> maps);
List<HashMap<String, Object>> queryMdmShowData(MdmQuery entity);
List<HashMap<String, Object>> queryTemplateDataMore(MdmDto entity);
@ -39,5 +41,11 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
List<HashMap<String, Object>> queryDataAll(MdmDto entity);
Integer deleteMdmModuleEntity(MdmModuleEntity entity);
Integer queryMainCount(MdmQuery mdmQuery);
Integer deleteTable(Map<String, Object> maps);
}

View File

@ -5,6 +5,7 @@ import com.hzya.frame.mdm.entity.MdmDto;
import com.hzya.frame.mdm.entity.MdmQuery;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.sys.entity.FormmainDeleteDto;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
@ -45,6 +46,19 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
List<HashMap<String, Object>> o = (List<HashMap<String, Object>>) super.selectList(getSqlIdPrifx() + "queryDataAll", entity);
return o;
}
@Override
public Integer deleteMdmModuleEntity(MdmModuleEntity entity) {
Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteMdmModuleEntity", entity);
return o;
}
@Override
public Integer queryMainCount(MdmQuery entity) {
Integer o = (Integer) super.getCount(getSqlIdPrifx() + "queryMainCount", entity);
return o;
}
@Override
public Integer checkData(Map<String, String> maps) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkData", maps);
@ -105,11 +119,22 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps);
return o;
}
@Override
public Integer deleteTable(Map<String, Object> maps) {
Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteTable", maps);
return o;
}
@Override
public Integer alterTable(Map<String, Object> maps) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps);
return o;
}
@Override
public Integer alterTableField(MdmModuleDbFiledsEntity entity) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTableField", entity);
return o;
}
@Override
public Integer alterTableName(Map<String, String> maps) {

View File

@ -2,26 +2,26 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.mdm.mdmModule.dao.impl.MdmModuleDaoImpl">
<resultMap id="get-MdmModuleEntity-result" type="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
<result property="mdmLogo" column="mdm_logo" jdbcType="VARCHAR"/>
<result property="mdmCode" column="mdm_code" jdbcType="INTEGER"/>
<result property="mdmType" column="mdm_type" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="createUser" column="createUser" jdbcType="VARCHAR"/>
<result property="modifyUser" column="modifyUser" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="get-MdmModuleEntity-result" type="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
<result property="mdmLogo" column="mdm_logo" jdbcType="VARCHAR"/>
<result property="mdmCode" column="mdm_code" jdbcType="INTEGER"/>
<result property="mdmType" column="mdm_type" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="createUser" column="createUser" jdbcType="VARCHAR"/>
<result property="modifyUser" column="modifyUser" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "MdmModuleEntity_Base_Column_List">
<sql id="MdmModuleEntity_Base_Column_List">
id
,mdm_name
,mdm_logo
@ -40,227 +40,243 @@
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
select
<include refid="MdmModuleEntity_Base_Column_List" />
<include refid="MdmModuleEntity_Base_Column_List"/>
from mdm_module where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
<include refid="MdmModuleEntity_Base_Column_List" />
from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
<if test="mdmLogo != null and mdmLogo != ''"> and mdm_logo = #{mdmLogo} </if>
<if test="mdmCode != null"> and mdm_code = #{mdmCode} </if>
<if test="mdmType != null and mdmType != ''"> and mdm_type = #{mdmType} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleEntity-result"
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
<include refid="MdmModuleEntity_Base_Column_List"/>
from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
<if test="mdmCode != null">and mdm_code = #{mdmCode}</if>
<if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select count(1) from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
<if test="mdmLogo != null and mdmLogo != ''"> and mdm_logo = #{mdmLogo} </if>
<if test="mdmCode != null"> and mdm_code = #{mdmCode} </if>
<if test="mdmType != null and mdmType != ''"> and mdm_type = #{mdmType} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select count(1) from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
<if test="mdmCode != null">and mdm_code = #{mdmCode}</if>
<if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmModuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
<include refid="MdmModuleEntity_Base_Column_List" />
from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name like concat('%',#{mdmName},'%') </if>
<if test="mdmLogo != null and mdmLogo != ''"> and mdm_logo like concat('%',#{mdmLogo},'%') </if>
<if test="mdmCode != null"> and mdm_code like concat('%',#{mdmCode},'%') </if>
<if test="mdmType != null and mdmType != ''"> and mdm_type like concat('%',#{mdmType},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
<select id="entity_list_like" resultMap="get-MdmModuleEntity-result"
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
<include refid="MdmModuleEntity_Base_Column_List"/>
from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="mdmName != null and mdmName != ''">and mdm_name like concat('%',#{mdmName},'%')</if>
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo like concat('%',#{mdmLogo},'%')</if>
<if test="mdmCode != null">and mdm_code like concat('%',#{mdmCode},'%')</if>
<if test="mdmType != null and mdmType != ''">and mdm_type like concat('%',#{mdmType},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleentity_list_or" resultMap="get-MdmModuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
<include refid="MdmModuleEntity_Base_Column_List" />
from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="mdmName != null and mdmName != ''"> or mdm_name = #{mdmName} </if>
<if test="mdmLogo != null and mdmLogo != ''"> or mdm_logo = #{mdmLogo} </if>
<if test="mdmCode != null"> or mdm_code = #{mdmCode} </if>
<if test="mdmType != null and mdmType != ''"> or mdm_type = #{mdmType} </if>
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleentity_list_or" resultMap="get-MdmModuleEntity-result"
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
<include refid="MdmModuleEntity_Base_Column_List"/>
from mdm_module
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="mdmName != null and mdmName != ''">or mdm_name = #{mdmName}</if>
<if test="mdmLogo != null and mdmLogo != ''">or mdm_logo = #{mdmLogo}</if>
<if test="mdmCode != null">or mdm_code = #{mdmCode}</if>
<if test="mdmType != null and mdmType != ''">or mdm_type = #{mdmType}</if>
<if test="remark != null and remark != ''">or remark = #{remark}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity" >
insert into mdm_module(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="mdmName != null and mdmName != ''"> mdm_name , </if>
<if test="mdmLogo != null and mdmLogo != ''"> mdm_logo , </if>
<if test="mdmCode != null"> mdm_code , </if>
<if test="mdmCode == null"> mdm_code , </if>
<if test="mdmType != null and mdmType != ''"> mdm_type , </if>
<if test="remark != null and remark != ''"> remark , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="mdmName != null and mdmName != ''"> #{mdmName} ,</if>
<if test="mdmLogo != null and mdmLogo != ''"> #{mdmLogo} ,</if>
<if test="mdmCode != null"> #{mdmCode} ,</if>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
insert into mdm_module(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="mdmName != null and mdmName != ''">mdm_name ,</if>
<if test="mdmLogo != null and mdmLogo != ''">mdm_logo ,</if>
<if test="mdmCode != null">mdm_code ,</if>
<if test="mdmCode == null">mdm_code ,</if>
<if test="mdmType != null and mdmType != ''">mdm_type ,</if>
<if test="remark != null and remark != ''">remark ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="mdmName != null and mdmName != ''">#{mdmName} ,</if>
<if test="mdmLogo != null and mdmLogo != ''">#{mdmLogo} ,</if>
<if test="mdmCode != null">#{mdmCode} ,</if>
<if test="mdmCode == null ">(SELECT IFNULL(MAX(b.mdm_code)+1,10001) AS mdmCode FROM mdm_module b ),</if>
<if test="mdmType != null and mdmType != ''"> #{mdmType} ,</if>
<if test="remark != null and remark != ''"> #{remark} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_name = values(mdm_name),
mdm_logo = values(mdm_logo),
mdm_code = values(mdm_code),
mdm_type = values(mdm_type),
remark = values(remark),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity" >
update mdm_module set
<trim suffix="" suffixOverrides=",">
<if test="mdmName != null and mdmName != ''"> mdm_name = #{mdmName},</if>
<if test="mdmLogo != null and mdmLogo != ''"> mdm_logo = #{mdmLogo},</if>
<if test="mdmCode != null"> mdm_code = #{mdmCode},</if>
<if test="mdmType != null and mdmType != ''"> mdm_type = #{mdmType},</if>
<if test="remark != null and remark != ''"> remark = #{remark},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity" >
<if test="mdmType != null and mdmType != ''">#{mdmType} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch">
insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time,
modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch">
insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time,
modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_name = values(mdm_name),
mdm_logo = values(mdm_logo),
mdm_code = values(mdm_code),
mdm_type = values(mdm_type),
remark = values(remark),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
update mdm_module set
<trim suffix="" suffixOverrides=",">
<if test="mdmName != null and mdmName != ''">mdm_name = #{mdmName},</if>
<if test="mdmLogo != null and mdmLogo != ''">mdm_logo = #{mdmLogo},</if>
<if test="mdmCode != null">mdm_code = #{mdmCode},</if>
<if test="mdmType != null and mdmType != ''">mdm_type = #{mdmType},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity" >
update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmName != null and mdmName != ''"> and mdm_name = #{mdmName} </if>
<if test="mdmLogo != null and mdmLogo != ''"> and mdm_logo = #{mdmLogo} </if>
<if test="mdmCode != null"> and mdm_code = #{mdmCode} </if>
<if test="mdmType != null and mdmType != ''"> and mdm_type = #{mdmType} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
<if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
<if test="mdmCode != null">and mdm_code = #{mdmCode}</if>
<if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from mdm_module where id = #{id}
</delete>
<delete id="deleteTable" >
DROP TABLE ${tableName}
</delete>
<!-- 分页查询列表 采用like格式 -->
<select id="queryMdm" resultMap="get-MdmModuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
<select id="queryMdm" resultMap="get-MdmModuleEntity-result"
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
select
a.id as id,
a.mdm_name as mdm_name,
@ -292,7 +308,7 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
<!--通过ID获取数据 -->
<select id="getByMdmCode" resultMap="get-MdmModuleEntity-result">
select
<include refid="MdmModuleEntity_Base_Column_List" />
<include refid="MdmModuleEntity_Base_Column_List"/>
from mdm_module where mdm_code = #{ mdmCode } and sts='Y'
</select>
<!--通过ID获取数据 -->
@ -307,42 +323,80 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
</select>
<select id="createTable" resultType="java.lang.Integer">
CREATE TABLE ${tableName} (
<foreach collection="databaseFields" item="item" index="index">
<choose>
<when test="item.enName == 'id'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
</when>
<when test="item.enName == 'sorts'.toString()">
`sorts` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '排序',
</when>
<otherwise >
<choose>
<when test="item.filedType == '1'.toString()">
${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
</when>
<when test="item.filedType == '2'.toString()">
${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
</when>
<when test="item.filedType == '3'.toString()">
${item.enName} varchar(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
</when>
<when test="item.filedType == '4'.toString()">
${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
</when>
</choose>
</otherwise>
</choose>
</foreach>
<choose>
<when test="tableType == '1'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
`document_rule` varchar(50) DEFAULT NULL COMMENT '单据规则',
`document_rule_num` bigint DEFAULT NULL COMMENT '单据规则流水号',
`data_status` varchar(1) DEFAULT NULL COMMENT '数据状态 Y正常 N删除 F修改',
`add_status` varchar(1) DEFAULT NULL COMMENT '新增数据状态 0待下发 1已下发',
`update_status` varchar(1) DEFAULT NULL COMMENT '修改数据状态 0待下发 1已下发',
`delete_status` varchar(1) DEFAULT NULL COMMENT '删除数据状态 0待下发 1已下发',
`sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
</when>
<when test="tableType == '2'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
`formmain_id` varchar(50) DEFAULT NULL COMMENT 'formmain_id',
`data_status` varchar(1) DEFAULT NULL COMMENT '数据状态 Y正常 N删除 F修改',
`sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
</when>
<when test="tableType == '3'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
`formmain_id` varchar(50) DEFAULT NULL COMMENT 'formmain_id',
`source_name` varchar(255) DEFAULT NULL COMMENT '来源名称',
`code` varchar(255) DEFAULT NULL COMMENT '编码',
`source_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '源数据',
`option_type` varchar(255) DEFAULT NULL COMMENT '操作类型',
`option_name` varchar(255) DEFAULT NULL COMMENT '操作人',
`sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
</when>
<when test="tableType == '4'.toString()">
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
`formmain_id` varchar(50) DEFAULT NULL COMMENT 'formmain_id',
`target_app` varchar(255) DEFAULT NULL COMMENT '目标应用',
`target_api` varchar(255) DEFAULT NULL COMMENT '目标api',
`source_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '源数据',
`option_type` varchar(255) DEFAULT NULL COMMENT '操作类型',
`sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
`create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
</when>
</choose>
PRIMARY KEY (`sorts`,`id`) USING BTREE
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = #{tableRemark}
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4
<if test="tableRemark != null and tableRemark != ''"> COMMENT = #{tableRemark} </if>
</select>
<!--通过ID获取数据 -->
<select id="alterTable" resultType="java.lang.Integer">
ALTER TABLE ${tableName}
@ -400,6 +454,77 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
</trim>
</select>
<select id="alterTableField" resultType="java.lang.Integer">
ALTER TABLE ${dbName}
<choose>
<when test="filedType == '1'.toString()">
<choose>
<when test="dataType == '1'.toString()">
add COLUMN ${enName} bigint(${filedLength}) DEFAULT NULL COMMENT
#{chName}
</when>
<when test="dataType == '3'.toString()">
drop COLUMN ${enName}
</when>
<otherwise>
MODIFY COLUMN ${enName} bigint(${filedLength}) DEFAULT NULL COMMENT
#{chName}
</otherwise>
</choose>
</when>
<when test="filedType == '3'.toString()">
<choose>
<when test="dataType == '1'.toString()">
add COLUMN ${enName} varchar(${filedLength}) DEFAULT NULL
COMMENT #{chName}
</when>
<when test="dataType == '3'.toString()">
drop COLUMN ${enName}
</when>
<otherwise>
MODIFY COLUMN ${enName} varchar(${filedLength}) DEFAULT NULL COMMENT
#{chName}
</otherwise>
</choose>
</when>
<when test="filedType == '2'.toString()">
<choose>
<when test="dataType == '1'.toString()">
add COLUMN ${enName} decimal(${filedLength}) DEFAULT NULL COMMENT
#{chName}
</when>
<when test="dataType == '3'.toString()">
drop COLUMN ${enName}
</when>
<otherwise>
MODIFY COLUMN ${enName} decimal(${filedLength}) DEFAULT NULL COMMENT
#{chName}
</otherwise>
</choose>
</when>
<when test="filedType == '4'.toString()">
<choose>
<when test="dataType == '1'.toString()">
add COLUMN ${enName} datetime DEFAULT NULL COMMENT #{chName}
</when>
<when test="dataType == '3'.toString()">
drop COLUMN ${enName}
</when>
<otherwise>
MODIFY COLUMN ${enName} datetime DEFAULT NULL COMMENT #{chName}
</otherwise>
</choose>
</when>
</choose>
</select>
<!--通过ID获取数据 -->
<select id="alterTableName" resultType="java.lang.Integer">
ALTER TABLE ${tableName} COMMENT = #{tableRemark}
@ -496,7 +621,7 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
order by sorts asc
</select>
<!-- 查询符合条件的数量 -->
<select id="checkData" resultType="Integer" >
<select id="checkData" resultType="Integer">
SELECT
count(*)
from
@ -657,5 +782,15 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
order by sorts asc
</select>
<!--通过mdmCode删除-->
<delete id="deleteMdmModuleEntity" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
delete from mdm_module where mdm_code = #{mdmCode}
</delete>
<!-- 查询符合条件的数量 -->
<select id="queryMainCount" resultType="Integer" parameterType="com.hzya.frame.mdm.entity.MdmQuery">
select count(1) from ${tableName} where sts='Y'
</select>
</mapper>

View File

@ -1,7 +1,10 @@
package com.hzya.frame.mdm.mdmModule.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 主数据模版(MdmModule)表服务接口
*
@ -9,4 +12,380 @@ import com.hzya.frame.basedao.service.IBaseService;
* @since 2024-06-03 08:46:29
*/
public interface IMdmModuleService extends IBaseService<MdmModuleEntity, String>{
/**
* @Author lvleigang
* @Description 查询所有主数据
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdm(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 删除主数据
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity deleteMdm(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-基本信息获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity getMdm(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-基本信息新增
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveMdm(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-基本信息修改同步修改菜单名称
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdm(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-单据规则获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity getMdmTableCodeRule(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-单据规则新增或修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveOrUpdateMdmTableCodeRule(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDb(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表新增
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveMdmDb(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdmDb(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表删除
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity deleteMdmDb(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDbField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段明细
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDbFieldDetail(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段新增
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveMdmDbField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdmDbField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段删除
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity deleteMdmDbField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段规则获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDbFieldRule(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-数据表字段规则修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdmDbFieldRule(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示类型获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmView(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示类型保存
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveMdmView(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示类型修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdmView(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示字段获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmViewField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示字段设置保存
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveOrUpdateMdmViewField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示按钮获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmViewButton(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-显示信息-显示按钮保存
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveOrUpdateMdmViewButton(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据来源-列表获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmSource(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据来源保存
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveMdmSource(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据来源获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity getMdmSource(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据来源修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdmSource(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据来源删除
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity deleteMdmSource(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-分发设置-列表获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDistribute(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-分发设置保存
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity saveMdmDistribute(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-分发设置获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity getMdmDistribute(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-分发设置修改
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity updateMdmDistribute(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-分发设置删除
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity deleteMdmDistribute(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-写入日志-列表获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmOptionLogPage(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-下发日志-列表获取
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmDistributeLogPage(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-服务获取只获取主表
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmService(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-服务字段获取只获取主表
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmServiceField(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-分发-只获取主表
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmMainDB(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 主数据-数据源-只获取主表字段
* @Date 11:43 上午 2024/6/11
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
**/
JsonResultEntity queryMdmMainDBField(JSONObject jsonObject);
}

View File

@ -17,5 +17,7 @@ public interface IMdmModuleDbDao extends IBaseDao<MdmModuleDbEntity, String> {
HashMap<String, Object> getServiceDataById(Map<String, Object> queryData);
List<HashMap<String, Object>> getServiceByFormmainId(Map<String, Object> queryData);
List<HashMap<String, Object>> getServiceByDistributeId(Map<String, Object> queryData);
int deleteMdmModuleDb(MdmModuleDbEntity mdmModuleDbEntity);
}

View File

@ -37,5 +37,11 @@ public class MdmModuleDbDaoImpl extends MybatisGenericDao<MdmModuleDbEntity, Str
}
@Override
public int deleteMdmModuleDb(MdmModuleDbEntity entity) {
Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteMdmModuleDb", entity);
return o;
}
}

View File

@ -2,23 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl">
<resultMap id="get-MdmModuleDbEntity-result" type="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="get-MdmModuleDbEntity-result" type="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "MdmModuleDbEntity_Base_Column_List">
<sql id="MdmModuleDbEntity_Base_Column_List">
id
,mdm_id
,db_name
@ -33,209 +33,222 @@
,org_id
,company_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select
<include refid="MdmModuleDbEntity_Base_Column_List" />
from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select
<include refid="MdmModuleDbEntity_Base_Column_List"/>
from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="dbType != null and dbType != ''">and db_type = #{dbType}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select count(1) from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select count(1) from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="dbType != null and dbType != ''">and db_type = #{dbType}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmModuleDbEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select
<include refid="MdmModuleDbEntity_Base_Column_List" />
from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
<if test="dbName != null and dbName != ''"> and db_name like concat('%',#{dbName},'%') </if>
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
<select id="entity_list_like" resultMap="get-MdmModuleDbEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select
<include refid="MdmModuleDbEntity_Base_Column_List"/>
from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="dbName != null and dbName != ''">and db_name like concat('%',#{dbName},'%')</if>
<if test="dbType != null and dbType != ''">and db_type like concat('%',#{dbType},'%')</if>
<if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbentity_list_or" resultMap="get-MdmModuleDbEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select
<include refid="MdmModuleDbEntity_Base_Column_List" />
from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
<if test="dbName != null and dbName != ''"> or db_name = #{dbName} </if>
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
<if test="remark != null and remark != ''"> or remark = #{remark} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbentity_list_or" resultMap="get-MdmModuleDbEntity-result"
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
select
<include refid="MdmModuleDbEntity_Base_Column_List"/>
from mdm_module_db
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="dbName != null and dbName != ''">or db_name = #{dbName}</if>
<if test="dbType != null and dbType != ''">or db_type = #{dbType}</if>
<if test="remark != null and remark != ''">or remark = #{remark}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity" >
insert into mdm_module_db(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="dbName != null and dbName != ''"> db_name , </if>
<if test="dbType != null and dbType != ''"> db_type , </if>
<if test="remark != null and remark != ''"> remark , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
<if test="dbName != null and dbName != ''"> #{dbName} ,</if>
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
<if test="remark != null and remark != ''"> #{remark} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
db_name = values(db_name),
db_type = values(db_type),
remark = values(remark),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity" >
update mdm_module_db set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
<if test="dbName != null and dbName != ''"> db_name = #{dbName},</if>
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
<if test="remark != null and remark != ''"> remark = #{remark},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity" >
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
insert into mdm_module_db(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="dbName != null and dbName != ''">db_name ,</if>
<if test="dbType != null and dbType != ''">db_type ,</if>
<if test="remark != null and remark != ''">remark ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="dbName != null and dbName != ''">#{dbName} ,</if>
<if test="dbType != null and dbType != ''">#{dbType} ,</if>
<if test="remark != null and remark != ''">#{remark} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch">
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id,
modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch">
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id,
modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
db_name = values(db_name),
db_type = values(db_type),
remark = values(remark),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id),
company_id = values(company_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
update mdm_module_db set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="dbName != null and dbName != ''">db_name = #{dbName},</if>
<if test="dbType != null and dbType != ''">db_type = #{dbType},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity" >
update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="dbType != null and dbType != ''">and db_type = #{dbType}</if>
<if test="remark != null and remark != ''">and remark = #{remark}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from mdm_module_db where id = #{id}
</delete>
<select id="getServiceDataById" resultType="java.util.HashMap" parameterType="java.util.HashMap">
@ -299,5 +312,9 @@ update mdm_module_db set sts= 'N' ,modify_time = #{modify_time},modify_user_id
order by sorts asc
</select>
<!--通过mdmCode删除-->
<delete id="deleteMdmModuleDb" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
delete from mdm_module_db where mdm_id = #{mdmId}
</delete>
</mapper>

View File

@ -11,5 +11,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface IMdmModuleDbFiledsDao extends IBaseDao<MdmModuleDbFiledsEntity, String> {
int deleteMdmModuleDbFileds(MdmModuleDbFiledsEntity entity);
}

View File

@ -12,6 +12,11 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
*/
@Repository(value = "MdmModuleDbFiledsDaoImpl")
public class MdmModuleDbFiledsDaoImpl extends MybatisGenericDao<MdmModuleDbFiledsEntity, String> implements IMdmModuleDbFiledsDao{
@Override
public int deleteMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) {
Integer o = (Integer) super.delete(getSqlIdPrifx() + "deleteMdmModuleDbFileds", entity);
return o;
}
}

View File

@ -5,6 +5,8 @@ import java.util.List;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.web.entity.BaseEntity;
import org.apache.poi.ss.formula.functions.T;
/**
* 模版数据库字段表(MdmModuleDbFileds)实体类
*
@ -13,6 +15,8 @@ import com.hzya.frame.web.entity.BaseEntity;
*/
public class MdmModuleDbFiledsEntity extends BaseEntity {
/** 主数据模版ID */
private String dbName;
/** 主数据模版ID */
private String mdmId;
/** 模版数据库id */
@ -41,6 +45,8 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
private String companyId;
/** 数据类型 1、新增 2、修改 */
private String dataType;
/** 类型 1、主表 2、明细 3、操作日志 4、下发日志 */
private String dbType;
/**
* roletype
*/
@ -51,6 +57,8 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
private String roleValue;
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
//1查询2列表3新增4修改 5查看
private String fieldType;
public String getMdmId() {
return mdmId;
}
@ -186,5 +194,29 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
public void setRoleValue(String roleValue) {
this.roleValue = roleValue;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getFieldType() {
return fieldType;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
}

View File

@ -326,6 +326,9 @@ update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_u
<delete id="entity_delete">
delete from mdm_module_db_fileds where id = #{id}
</delete>
<!--通过mdmCode删除-->
<delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
delete from mdm_module_db_fileds where mdm_id = #{mdmId}
</delete>
</mapper>

View File

@ -11,5 +11,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface IMdmModuleDbFiledsRuleDao extends IBaseDao<MdmModuleDbFiledsRuleEntity, String> {
Integer queryUserMdm(MdmModuleDbFiledsRuleEntity queryCount);
}

View File

@ -12,6 +12,11 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
*/
@Repository(value = "MdmModuleDbFiledsRuleDaoImpl")
public class MdmModuleDbFiledsRuleDaoImpl extends MybatisGenericDao<MdmModuleDbFiledsRuleEntity, String> implements IMdmModuleDbFiledsRuleDao{
@Override
public Integer queryUserMdm(MdmModuleDbFiledsRuleEntity queryCount) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "queryUserMdm", queryCount);
return o;
}
}

View File

@ -283,5 +283,17 @@ update mdm_module_db_fileds_rule set sts= 'N' ,modify_time = #{modify_time},mod
delete from mdm_module_db_fileds_rule where id = #{id}
</delete>
<!-- 查询符合条件的数量 -->
<select id="queryUserMdm" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
select count(1) from mdm_module_db_fileds_rule
<trim prefix="where" prefixOverrides="and">
<if test="mdmId != null and mdmId != ''"> and mdm_id != #{mdmId} </if>
<if test="ruleCode != null and ruleCode != ''"> and rule_code = #{ruleCode} </if>
<if test="ruleValue != null and ruleValue != ''"> and rule_value = #{ruleValue} </if>
and sts='Y'
</trim>
</select>
</mapper>

View File

@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
* 主数据功能应用分发表(mdm_module_distribute: table)表数据库访问层
*
* @author makejava
* @since 2024-06-03 08:47:33
* @since 2024-06-14 10:06:36
*/
public interface IMdmModuleDistributeDao extends IBaseDao<MdmModuleDistributeEntity, String> {

View File

@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
* 主数据功能应用分发表(MdmModuleDistribute)表数据库访问层
*
* @author makejava
* @since 2024-06-03 08:47:33
* @since 2024-06-14 10:06:36
*/
@Repository(value = "MdmModuleDistributeDaoImpl")
public class MdmModuleDistributeDaoImpl extends MybatisGenericDao<MdmModuleDistributeEntity, String> implements IMdmModuleDistributeDao{

View File

@ -9,7 +9,7 @@ import com.hzya.frame.web.entity.BaseEntity;
* 主数据功能应用分发表(MdmModuleDistribute)实体类
*
* @author makejava
* @since 2024-06-03 08:47:33
* @since 2024-06-14 10:06:36
*/
public class MdmModuleDistributeEntity extends BaseEntity {
@ -25,8 +25,11 @@ public class MdmModuleDistributeEntity extends BaseEntity {
private String deleteApi;
/** 启用停用 0、停用1、启用 */
private String enabledState;
/** 主表ID */
private String dbId;
/** 公司id */
private String companyId;
private List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities;
public String getMdmId() {
@ -77,6 +80,14 @@ public class MdmModuleDistributeEntity extends BaseEntity {
this.enabledState = enabledState;
}
public String getDbId() {
return dbId;
}
public void setDbId(String dbId) {
this.dbId = dbId;
}
public String getCompanyId() {
return companyId;
}

View File

@ -10,6 +10,7 @@
<result property="addApi" column="add_api" jdbcType="VARCHAR"/>
<result property="deleteApi" column="delete_api" jdbcType="VARCHAR"/>
<result property="enabledState" column="enabled_state" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
@ -28,6 +29,7 @@
,add_api
,delete_api
,enabled_state
,db_id
,sorts
,create_user_id
,create_time
@ -37,6 +39,13 @@
,org_id
,company_id
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-MdmModuleDistributeEntity-result">
select
<include refid="MdmModuleDistributeEntity_Base_Column_List" />
from mdm_module_distribute where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDistributeEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity">
select
@ -50,6 +59,7 @@
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
<if test="enabledState != null and enabledState != ''"> and enabled_state = #{enabledState} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
@ -75,6 +85,7 @@
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
<if test="enabledState != null and enabledState != ''"> and enabled_state = #{enabledState} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
@ -102,6 +113,7 @@
<if test="addApi != null and addApi != ''"> and add_api like concat('%',#{addApi},'%') </if>
<if test="deleteApi != null and deleteApi != ''"> and delete_api like concat('%',#{deleteApi},'%') </if>
<if test="enabledState != null and enabledState != ''"> and enabled_state like concat('%',#{enabledState},'%') </if>
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
@ -129,6 +141,7 @@
<if test="addApi != null and addApi != ''"> or add_api = #{addApi} </if>
<if test="deleteApi != null and deleteApi != ''"> or delete_api = #{deleteApi} </if>
<if test="enabledState != null and enabledState != ''"> or enabled_state = #{enabledState} </if>
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
@ -144,7 +157,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" >
insert into mdm_module_distribute(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -154,6 +167,7 @@
<if test="addApi != null and addApi != ''"> add_api , </if>
<if test="deleteApi != null and deleteApi != ''"> delete_api , </if>
<if test="enabledState != null and enabledState != ''"> enabled_state , </if>
<if test="dbId != null and dbId != ''"> db_id , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
@ -162,6 +176,7 @@
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -173,6 +188,7 @@
<if test="addApi != null and addApi != ''"> #{addApi} ,</if>
<if test="deleteApi != null and deleteApi != ''"> #{deleteApi} ,</if>
<if test="enabledState != null and enabledState != ''"> #{enabledState} ,</if>
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
@ -181,24 +197,25 @@
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
<insert id="entityInsertBatch" >
insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
(#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_distribute(mdm_id, app_id, update_api, add_api, delete_api, enabled_state, db_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
(#{entity.mdmId},#{entity.appId},#{entity.updateApi},#{entity.addApi},#{entity.deleteApi},#{entity.enabledState},#{entity.dbId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
@ -207,6 +224,7 @@
add_api = values(add_api),
delete_api = values(delete_api),
enabled_state = values(enabled_state),
db_id = values(db_id),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
@ -224,6 +242,7 @@ update mdm_module_distribute set
<if test="addApi != null and addApi != ''"> add_api = #{addApi},</if>
<if test="deleteApi != null and deleteApi != ''"> delete_api = #{deleteApi},</if>
<if test="enabledState != null and enabledState != ''"> enabled_state = #{enabledState},</if>
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
@ -250,6 +269,7 @@ update mdm_module_distribute set sts= 'N' ,modify_time = #{modify_time},modify_
<if test="addApi != null and addApi != ''"> and add_api = #{addApi} </if>
<if test="deleteApi != null and deleteApi != ''"> and delete_api = #{deleteApi} </if>
<if test="enabledState != null and enabledState != ''"> and enabled_state = #{enabledState} </if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>

View File

@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService;
* 主数据功能应用分发表(MdmModuleDistribute)表服务接口
*
* @author makejava
* @since 2024-06-03 08:47:33
* @since 2024-06-14 10:06:36
*/
public interface IMdmModuleDistributeService extends IBaseService<MdmModuleDistributeEntity, String>{
}

View File

@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService;
* 主数据功能应用分发表(MdmModuleDistribute)表服务实现类
*
* @author makejava
* @since 2024-06-03 08:47:33
* @since 2024-06-14 10:06:36
*/
@Service(value = "mdmModuleDistributeService")
public class MdmModuleDistributeServiceImpl extends BaseService<MdmModuleDistributeEntity, String> implements IMdmModuleDistributeService {

View File

@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
* 主数据功能应用分发明细表(mdm_module_distribute_detail: table)表数据库访问层
*
* @author makejava
* @since 2024-06-03 08:48:18
* @since 2024-06-14 10:03:50
*/
public interface IMdmModuleDistributeDetailDao extends IBaseDao<MdmModuleDistributeDetailEntity, String> {

View File

@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)表数据库访问层
*
* @author makejava
* @since 2024-06-03 08:48:18
* @since 2024-06-14 10:03:50
*/
@Repository(value = "MdmModuleDistributeDetailDaoImpl")
public class MdmModuleDistributeDetailDaoImpl extends MybatisGenericDao<MdmModuleDistributeDetailEntity, String> implements IMdmModuleDistributeDetailDao{

View File

@ -6,7 +6,7 @@ import com.hzya.frame.web.entity.BaseEntity;
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)实体类
*
* @author makejava
* @since 2024-06-03 08:48:18
* @since 2024-06-14 10:03:50
*/
public class MdmModuleDistributeDetailEntity extends BaseEntity {
@ -18,12 +18,18 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity {
private String apiId;
/** 数据类型 1、新增2、修改3、删除 */
private String dataType;
/** 左括号 */
private String leftBracket;
/** 字段名 */
private String filedName;
/** 对比类型 1、等于 */
/** 对比类型 1、等于 2、不等于 3、大于 4、小于 */
private String compareType;
/** 目标API字段默认值 */
private String filedVaule;
/** 连接符号 1\and 2\or */
private String connectionSymbol;
/** 右括号 */
private String rightParenthesis;
/** 公司id */
private String companyId;
@ -60,6 +66,14 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity {
this.dataType = dataType;
}
public String getLeftBracket() {
return leftBracket;
}
public void setLeftBracket(String leftBracket) {
this.leftBracket = leftBracket;
}
public String getFiledName() {
return filedName;
}
@ -84,6 +98,22 @@ public class MdmModuleDistributeDetailEntity extends BaseEntity {
this.filedVaule = filedVaule;
}
public String getConnectionSymbol() {
return connectionSymbol;
}
public void setConnectionSymbol(String connectionSymbol) {
this.connectionSymbol = connectionSymbol;
}
public String getRightParenthesis() {
return rightParenthesis;
}
public void setRightParenthesis(String rightParenthesis) {
this.rightParenthesis = rightParenthesis;
}
public String getCompanyId() {
return companyId;
}

View File

@ -8,9 +8,12 @@
<result property="distributeId" column="distribute_id" jdbcType="VARCHAR"/>
<result property="apiId" column="api_id" jdbcType="VARCHAR"/>
<result property="dataType" column="data_type" jdbcType="VARCHAR"/>
<result property="leftBracket" column="left_bracket" jdbcType="VARCHAR"/>
<result property="filedName" column="filed_name" jdbcType="VARCHAR"/>
<result property="compareType" column="compare_type" jdbcType="VARCHAR"/>
<result property="filedVaule" column="filed_vaule" jdbcType="VARCHAR"/>
<result property="connectionSymbol" column="connection_symbol" jdbcType="VARCHAR"/>
<result property="rightParenthesis" column="right_parenthesis" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
@ -27,9 +30,12 @@
,distribute_id
,api_id
,data_type
,left_bracket
,filed_name
,compare_type
,filed_vaule
,connection_symbol
,right_parenthesis
,sorts
,create_user_id
,create_time
@ -39,6 +45,12 @@
,org_id
,company_id
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-MdmModuleDistributeDetailEntity-result">
select
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
from mdm_module_distribute_detail where id = #{ id } and sts='Y'
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
select
@ -50,9 +62,12 @@
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
<if test="dataType != null and dataType != ''"> and data_type = #{dataType} </if>
<if test="leftBracket != null and leftBracket != ''"> and left_bracket = #{leftBracket} </if>
<if test="filedName != null and filedName != ''"> and filed_name = #{filedName} </if>
<if test="compareType != null and compareType != ''"> and compare_type = #{compareType} </if>
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule = #{filedVaule} </if>
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol = #{connectionSymbol} </if>
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis = #{rightParenthesis} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
@ -76,9 +91,12 @@
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
<if test="dataType != null and dataType != ''"> and data_type = #{dataType} </if>
<if test="leftBracket != null and leftBracket != ''"> and left_bracket = #{leftBracket} </if>
<if test="filedName != null and filedName != ''"> and filed_name = #{filedName} </if>
<if test="compareType != null and compareType != ''"> and compare_type = #{compareType} </if>
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule = #{filedVaule} </if>
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol = #{connectionSymbol} </if>
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis = #{rightParenthesis} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
@ -104,9 +122,12 @@
<if test="distributeId != null and distributeId != ''"> and distribute_id like concat('%',#{distributeId},'%') </if>
<if test="apiId != null and apiId != ''"> and api_id like concat('%',#{apiId},'%') </if>
<if test="dataType != null and dataType != ''"> and data_type like concat('%',#{dataType},'%') </if>
<if test="leftBracket != null and leftBracket != ''"> and left_bracket like concat('%',#{leftBracket},'%') </if>
<if test="filedName != null and filedName != ''"> and filed_name like concat('%',#{filedName},'%') </if>
<if test="compareType != null and compareType != ''"> and compare_type like concat('%',#{compareType},'%') </if>
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule like concat('%',#{filedVaule},'%') </if>
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol like concat('%',#{connectionSymbol},'%') </if>
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis like concat('%',#{rightParenthesis},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
@ -132,9 +153,12 @@
<if test="distributeId != null and distributeId != ''"> or distribute_id = #{distributeId} </if>
<if test="apiId != null and apiId != ''"> or api_id = #{apiId} </if>
<if test="dataType != null and dataType != ''"> or data_type = #{dataType} </if>
<if test="leftBracket != null and leftBracket != ''"> or left_bracket = #{leftBracket} </if>
<if test="filedName != null and filedName != ''"> or filed_name = #{filedName} </if>
<if test="compareType != null and compareType != ''"> or compare_type = #{compareType} </if>
<if test="filedVaule != null and filedVaule != ''"> or filed_vaule = #{filedVaule} </if>
<if test="connectionSymbol != null and connectionSymbol != ''"> or connection_symbol = #{connectionSymbol} </if>
<if test="rightParenthesis != null and rightParenthesis != ''"> or right_parenthesis = #{rightParenthesis} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
@ -150,7 +174,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
insert into mdm_module_distribute_detail(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -158,9 +182,12 @@
<if test="distributeId != null and distributeId != ''"> distribute_id , </if>
<if test="apiId != null and apiId != ''"> api_id , </if>
<if test="dataType != null and dataType != ''"> data_type , </if>
<if test="leftBracket != null and leftBracket != ''"> left_bracket , </if>
<if test="filedName != null and filedName != ''"> filed_name , </if>
<if test="compareType != null and compareType != ''"> compare_type , </if>
<if test="filedVaule != null and filedVaule != ''"> filed_vaule , </if>
<if test="connectionSymbol != null and connectionSymbol != ''"> connection_symbol , </if>
<if test="rightParenthesis != null and rightParenthesis != ''"> right_parenthesis , </if>
<if test="sorts != null"> sorts , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="create_time != null"> create_time , </if>
@ -169,6 +196,7 @@
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="companyId != null and companyId != ''"> company_id , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
@ -178,9 +206,12 @@
<if test="distributeId != null and distributeId != ''"> #{distributeId} ,</if>
<if test="apiId != null and apiId != ''"> #{apiId} ,</if>
<if test="dataType != null and dataType != ''"> #{dataType} ,</if>
<if test="leftBracket != null and leftBracket != ''"> #{leftBracket} ,</if>
<if test="filedName != null and filedName != ''"> #{filedName} ,</if>
<if test="compareType != null and compareType != ''"> #{compareType} ,</if>
<if test="filedVaule != null and filedVaule != ''"> #{filedVaule} ,</if>
<if test="connectionSymbol != null and connectionSymbol != ''"> #{connectionSymbol} ,</if>
<if test="rightParenthesis != null and rightParenthesis != ''"> #{rightParenthesis} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
@ -189,33 +220,37 @@
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" >
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, filed_name, compare_type, filed_vaule, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
<insert id="entityInsertBatch" >
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, filed_name, compare_type, filed_vaule, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
</foreach>
on duplicate key update
mdm_id = values(mdm_id),
distribute_id = values(distribute_id),
api_id = values(api_id),
data_type = values(data_type),
left_bracket = values(left_bracket),
filed_name = values(filed_name),
compare_type = values(compare_type),
filed_vaule = values(filed_vaule),
connection_symbol = values(connection_symbol),
right_parenthesis = values(right_parenthesis),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
@ -231,9 +266,12 @@ update mdm_module_distribute_detail set
<if test="distributeId != null and distributeId != ''"> distribute_id = #{distributeId},</if>
<if test="apiId != null and apiId != ''"> api_id = #{apiId},</if>
<if test="dataType != null and dataType != ''"> data_type = #{dataType},</if>
<if test="leftBracket != null and leftBracket != ''"> left_bracket = #{leftBracket},</if>
<if test="filedName != null and filedName != ''"> filed_name = #{filedName},</if>
<if test="compareType != null and compareType != ''"> compare_type = #{compareType},</if>
<if test="filedVaule != null and filedVaule != ''"> filed_vaule = #{filedVaule},</if>
<if test="connectionSymbol != null and connectionSymbol != ''"> connection_symbol = #{connectionSymbol},</if>
<if test="rightParenthesis != null and rightParenthesis != ''"> right_parenthesis = #{rightParenthesis},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
@ -258,9 +296,12 @@ update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
<if test="dataType != null and dataType != ''"> and data_type = #{dataType} </if>
<if test="leftBracket != null and leftBracket != ''"> and left_bracket = #{leftBracket} </if>
<if test="filedName != null and filedName != ''"> and filed_name = #{filedName} </if>
<if test="compareType != null and compareType != ''"> and compare_type = #{compareType} </if>
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule = #{filedVaule} </if>
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol = #{connectionSymbol} </if>
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis = #{rightParenthesis} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>

View File

@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService;
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务接口
*
* @author makejava
* @since 2024-06-03 08:48:18
* @since 2024-06-14 10:03:50
*/
public interface IMdmModuleDistributeDetailService extends IBaseService<MdmModuleDistributeDetailEntity, String>{
}

View File

@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService;
* 主数据功能应用分发明细表(MdmModuleDistributeDetail)表服务实现类
*
* @author makejava
* @since 2024-06-03 08:48:18
* @since 2024-06-14 10:03:50
*/
@Service(value = "mdmModuleDistributeDetailService")
public class MdmModuleDistributeDetailServiceImpl extends BaseService<MdmModuleDistributeDetailEntity, String> implements IMdmModuleDistributeDetailService {

View File

@ -12,7 +12,7 @@ public class MdmModuleSourceEntity extends BaseEntity {
/** 主数据模版ID */
private String mdmId;
/** 来源类型 */
/** 来源类型1、插件2、api */
private String sourceType;
/** 来源名称 */
private String sourceName;

View File

@ -33,6 +33,11 @@
,org_id
,company_id
</sql>
<select id="entity_get" resultMap="get-MdmModuleSourceEntity-result">
select
<include refid="MdmModuleSourceEntity_Base_Column_List" />
from mdm_module_source where sts = 'Y' and id = #{id}
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleSourceEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity">
select

View File

@ -1,5 +1,6 @@
package com.hzya.frame.mdm.mdmModuleView.dao;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
@ -11,5 +12,6 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface IMdmModuleViewDao extends IBaseDao<MdmModuleViewEntity, String> {
Integer queryUserMdm(MdmModuleViewEntity mdmModuleViewEntity);
}

View File

@ -1,5 +1,6 @@
package com.hzya.frame.mdm.mdmModuleView.dao.impl;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao;
import org.springframework.stereotype.Repository;
@ -12,6 +13,14 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
*/
@Repository(value = "MdmModuleViewDaoImpl")
public class MdmModuleViewDaoImpl extends MybatisGenericDao<MdmModuleViewEntity, String> implements IMdmModuleViewDao{
@Override
public Integer queryUserMdm(MdmModuleViewEntity mdmModuleViewEntity) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "queryUserMdm", mdmModuleViewEntity);
return o;
}
}

View File

@ -12,7 +12,7 @@ public class MdmModuleViewEntity extends BaseEntity {
/** 主数据模版ID */
private String mdmId;
/** 显示类型 */
/** 显示类型 1、树2、列表*/
private String viewName;
/** 显示字段 */
private String viewFiled;

View File

@ -238,6 +238,14 @@ update mdm_module_view set sts= 'N' ,modify_time = #{modify_time},modify_user_i
<delete id="entity_delete">
delete from mdm_module_view where id = #{id}
</delete>
<!-- 查询符合条件的数量 -->
<select id="queryUserMdm" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity">
select count(1) from mdm_module_view
<trim prefix="where" prefixOverrides="and">
and mdm_id = #{mdmId}
and (view_filed = #{viewFiled} or up_id_filed = #{upIdFiled})
and sts='Y'
</trim>
</select>
</mapper>

View File

@ -14,7 +14,7 @@ public class MdmModuleViewButtonEntity extends BaseEntity {
private String mdmId;
/** 视图id */
private String viewId;
/** 类型1、新建2、重置3、查询4、修改 5、删除 6、查看 */
/** 类型1、新建2、重置3、查询4、修改 5、删除 6、查看 7、下发 */
private String buttonType;
/** 按钮值 */
private String buttonValue;

View File

@ -16,6 +16,8 @@ public class MdmModuleViewDetailEntity extends BaseEntity {
private String viewId;
/** 字段 */
private String viewFiled;
/** 字段 */
private String viewName;
/** 类型1、查询2、列表3、新增4、修改 5、查看 */
private String viewType;
/** 公司id */
@ -70,5 +72,13 @@ public class MdmModuleViewDetailEntity extends BaseEntity {
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getViewName() {
return viewName;
}
public void setViewName(String viewName) {
this.viewName = viewName;
}
}

View File

@ -8,222 +8,6 @@ import com.hzya.frame.web.entity.JsonResultEntity;
*/
public interface IMdmService {
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据列表查询接口分页
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据列表查询接口列表
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmList(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据新增
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity addMdm(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据基本信息获取
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModule(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据基本信息修改
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity doSaveMdmModule(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询数据源
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleDb(JSONObject jsonObject);
//
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询数据源的服务
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleServer(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询数据源字段的服务
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleServerFiled(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询主表字段
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleServerMainFiled(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置保存数据源
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity saveMdmModuleDb(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询显示信息
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleView(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置修改显示信息
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据设置查询权限配置
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmModuleRule(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据设置保存权限配置
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity doSaveMdmModuleRule(JSONObject jsonObject);
//
//
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询分发设置
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleDistribute(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置保存分发设置
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity doSaveMdmModuleDistribute(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置查询数据来源
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity queryMdmModuleSource(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 主数据设置保存数据来源
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity doSaveMdmModuleSource(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询下发日志
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity querySendEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取下发日志
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getSendEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除下发日志
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity deleteSendEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询操作日志
* @Date 11:52 上午 2024/3/27
**/
JsonResultEntity queryOptionEntityPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取操作日志
* @Date 2:36 下午 2024/3/27
**/
JsonResultEntity getOptionEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除操作日志
* @Date 2:37 下午 2024/3/27
**/
JsonResultEntity deleteOptionEntity(JSONObject jsonObject);
//
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
@ -326,7 +110,6 @@ public interface IMdmService {
* @Date 9:40 上午 2023/10/18
**/
JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
@ -336,4 +119,5 @@ public interface IMdmService {
// **/
//JsonResultEntity doMdmDistribute(JSONObject jsonObject);
}

View File

@ -13,6 +13,8 @@ import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity;
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.util.List;
@ -21,7 +23,6 @@ import java.util.List;
*/
public interface IMdmServiceCache {
/**
* @Author lvleigang
* @Description 获取模版主表
@ -30,14 +31,24 @@ public interface IMdmServiceCache {
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
MdmModuleEntity getMdmModuleEntity(Long mdmCode);
/**
* @Author lvleigang
* @Description 获取模版单据编码规则
* @Description 修改模版主表
* @Date 10:13 上午 2024/6/3
* @param mdmTableCodeRuleEntity
* @param entity
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
List<MdmTableCodeRuleEntity> queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity);
void updateMdmModuleEntity(MdmModuleEntity entity);
/**
* @Author lvleigang
* @Description 删除模版主表
* @Date 10:13 上午 2024/6/3
* @param entity
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
void deleteMdmModuleEntity(MdmModuleEntity entity);
/**
* @Author lvleigang
* @Description 获取模版表数据
@ -46,6 +57,26 @@ public interface IMdmServiceCache {
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity queryDb);
/**
* @Author lvleigang
* @Description 修改模版表数据
* @Date 4:23 下午 2024/6/11
* @param mdmId
* @param mdmModuleDbEntities
* @return void
**/
void saveOrUpdateMdmModuleDb(String mdmId, List<MdmModuleDbEntity> mdmModuleDbEntities);
/**
* @Author lvleigang
* @Description 删除模版表数据
* @Date 4:23 下午 2024/6/11
* @param mdmId
* @return void
**/
void deleteMdmModuleDb(String mdmId,String dbID);
/**
* @Author lvleigang
* @Description 获取模版字段表数据
@ -55,38 +86,21 @@ public interface IMdmServiceCache {
**/
List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled);
void updateMdmModuleEntity(MdmModuleEntity entity);
List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule);
void saveMdmTableCodeRule(String mdmid, List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities);
void saveMdmModuleDb(String id, List<MdmModuleDbEntity> mdmModuleDbEntities);
void saveMdmModuleDbFileds(String id, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities);
void saveMdmModuleDbFiledsRule(String id, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities);
List<MdmModuleViewDetailEntity> queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity);
List<MdmModuleViewEntity> queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity);
List<MdmModuleViewButtonEntity> queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity);
void saveMdmModuleView(String id, MdmModuleViewEntity mdmModuleViewEntity);
void saveMdmModuleViewDetail(String id, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities);
void saveMdmModuleViewButton(String id, List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities);
List<MdmModuleDistributeEntity> queryMdmModuleDistribute(String id,MdmModuleDistributeEntity mdmModuleDistributeEntity);
void saveMdmModuleDistribute(String id, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities);
List<MdmModuleSourceEntity> queryMdmModuleSource(MdmModuleSourceEntity mdmModuleSourceEntity);
void saveMdmModuleSource(String id, List<MdmModuleSourceEntity> mdmModuleSourceEntities);
List<MdmModuleDistributeDetailEntity> queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity);
/**
* @Author lvleigang
* @Description 修改数据源db的字段
* @Date 4:25 下午 2024/6/11
* @param mdmId
* @param mdmModuleDbFiledsEntities
* @return void
**/
void saveOrUpdateMdmModuleDbFileds(String mdmId, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities);
/**
* @Author lvleigang
* @Description 删除数据源db的字段
* @Date 4:25 下午 2024/6/11
* @param mdmId
* @return void
**/
void deleteMdmModuleDbFileds(String mdmId,String dbID);
}

View File

@ -73,27 +73,53 @@ public class MdmServiceCache implements IMdmServiceCache {
@Resource
private IMdmTableCodeRuleDao mdmTableCodeRuleDao;
/**
* @Author lvleigang
* @Description 缓存主数据
* @Date 4:03 下午 2024/6/11
* @param mdmCode
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
@Override
@Cacheable(cacheNames="mdmModule",key = "#mdmCode")
public MdmModuleEntity getMdmModuleEntity(Long mdmCode) {
MdmModuleEntity entity = mdmModuleDao.getByMdmCode(mdmCode);
return entity;
}
/**
* @Author lvleigang
* @Description 缓存删除主数据
* @Date 4:03 下午 2024/6/11
* @param entity
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
@Override
@CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode")
public void updateMdmModuleEntity(MdmModuleEntity entity) {
mdmModuleDao.update(entity);
}
/**
* @param entity
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
* @Author lvleigang
* @Description 删除模版主表
* @Date 10:13 上午 2024/6/3
**/
@Override
@Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId")
public List<MdmTableCodeRuleEntity> queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) {
List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity);
return mdmTableCodeRuleEntityList;
@CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode")
public void deleteMdmModuleEntity(MdmModuleEntity entity) {
entity.setUpdate();
mdmModuleDao.logicRemoveMultiCondition(entity);
}
/**
* @Author lvleigang
* @Description 缓存主数据DB
* @Date 4:03 下午 2024/6/11
* @param entity
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
@Override
@Cacheable(cacheNames="mdmModuleDb",key = "#entity.mdmId")
public List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity entity) {
@ -101,38 +127,17 @@ public class MdmServiceCache implements IMdmServiceCache {
return mdmModuleDbEntities;
}
@Override
@Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId")
public List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) {
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity);
return mdmModuleDbFiledsEntities;
}
@Override
@Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId")
public List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) {
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity);
return mdmModuleDbFiledsRuleEntities;
}
@Override
@CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId")
public void saveMdmTableCodeRule(String mdmId, List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities) {
MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity();
mdmTableCodeRuleEntity.setMdmId(mdmId);
mdmTableCodeRuleEntity.setSts("Y");
mdmTableCodeRuleEntity.setUpdate();
mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity);
if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){
for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) {
mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i));
}
}
}
/**
* @Author lvleigang
* @Description 修改模版表数据
* @Date 4:23 下午 2024/6/11
* @param mdmId
* @param mdmModuleDbEntities
* @return void
**/
@Override
@CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId")
public void saveMdmModuleDb(String mdmId, List<MdmModuleDbEntity> mdmModuleDbEntities) {
public void saveOrUpdateMdmModuleDb(String mdmId, List<MdmModuleDbEntity> mdmModuleDbEntities) {
if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
if("1".equals(mdmModuleDbEntities.get(i).getDataType())){
@ -143,204 +148,318 @@ public class MdmServiceCache implements IMdmServiceCache {
}
}
}
/**
* @param mdmId
* @return void
* @Author lvleigang
* @Description 删除模版表数据
* @Date 4:23 下午 2024/6/11
**/
@Override
@CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId")
public void deleteMdmModuleDb(String mdmId,String dbID) {
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
mdmModuleDbEntity.setMdmId(mdmId);
mdmModuleDbEntity.setId(dbID);
mdmModuleDbEntity.setUpdate();
mdmModuleDbDao.logicRemoveMultiCondition(mdmModuleDbEntity);
}
/**
* @Author lvleigang
* @Description 缓存主数据DB的所有字段
* @Date 4:11 下午 2024/6/11
* @param entity
* @return java.util.List<com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity>
**/
@Override
@Cacheable(cacheNames="mdmModuleDbFileds",key = "#entity.mdmId")
public List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) {
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity);
return mdmModuleDbFiledsEntities;
}
/**
* @Author lvleigang
* @Description 修改数据源db的字段
* @Date 4:25 下午 2024/6/11
* @param mdmId
* @param mdmModuleDbFiledsEntities
* @return void
**/
@Override
@CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId")
public void saveMdmModuleDbFileds(String mdmId, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
public void saveOrUpdateMdmModuleDbFileds(String mdmId, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) {
if("1".equals(mdmModuleDbFiledsEntities.get(i).getDataType())){
mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntities.get(i));
}else {
}else if ("2".equals(mdmModuleDbFiledsEntities.get(i).getDataType())) {
mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntities.get(i));
}
}
}
}
@Override
@CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId")
public void saveMdmModuleDbFiledsRule(String mdmId, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities) {
MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity();
mdmModuleDbFiledsRuleEntity.setMdmId(mdmId);
mdmModuleDbFiledsRuleEntity.setSts("Y");
mdmModuleDbFiledsRuleEntity.setUpdate();
mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity);
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) {
if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){
mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i));
}else {
mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i));
}else if ("3".equals(mdmModuleDbFiledsEntities.get(i).getDataType())) {
mdmModuleDbFiledsDao.logicRemoveMultiCondition(mdmModuleDbFiledsEntities.get(i));
}
}
}
}
/**
* @param mdmId
* @return void
* @Author lvleigang
* @Description 删除数据源db的字段
* @Date 4:25 下午 2024/6/11
**/
@Override
@Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId")
public List<MdmModuleViewDetailEntity> queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) {
List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity);
return mdmModuleViewDetailEntities;
@CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId")
public void deleteMdmModuleDbFileds(String mdmId,String dbID) {
MdmModuleDbFiledsEntity entity = new MdmModuleDbFiledsEntity();
entity.setMdmId(mdmId);
entity.setDbId(dbID);
entity.setUpdate();
mdmModuleDbFiledsDao.logicRemoveMultiCondition(entity);
}
@Override
@Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId")
public List<MdmModuleViewEntity> queryMdmModuleView(MdmModuleViewEntity entity) {
List<MdmModuleViewEntity> moduleViewEntities = mdmModuleViewDao.queryBase(entity);
return moduleViewEntities;
}
//
///**
// * @Author lvleigang
// * @Description 缓存主数据DB的所有字段的规则
// * @Date 4:11 下午 2024/6/11
// * @param entity
// * @return java.util.List<com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity>
// **/
//@Override
//@Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#entity.mdmId")
//public List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) {
// List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity);
// return mdmModuleDbFiledsRuleEntities;
//}
//
//@Override
//@Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId")
//public List<MdmModuleDistributeEntity> queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) {
// List<MdmModuleDistributeEntity> mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity);
// //查询模块下的应用列表
// MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity();
// mdmModuleDistributeDetailEntity.setSts("Y");
// mdmModuleDistributeDetailEntity.setMdmId(mdmId);
// List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
// if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){
// for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) {
// List<MdmModuleDistributeDetailEntity> moduleDistributeDetailEntities = new ArrayList<>();
// if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){
// for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) {
// if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){
// moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1));
// }
// }
// }
// mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities);
// }
// }
// return mdmModuleDistributeEntities;
//}
//
//
//
//@Override
//@Cacheable(cacheNames="mdmTableCodeRule",key = "#entity.mdmId")
//public List<MdmTableCodeRuleEntity> queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) {
// List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity);
// return mdmTableCodeRuleEntityList;
//}
//
//
//
//@Override
//@CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId")
//public void saveMdmTableCodeRule(String mdmId, List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities) {
// MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity();
// mdmTableCodeRuleEntity.setMdmId(mdmId);
// mdmTableCodeRuleEntity.setSts("Y");
// mdmTableCodeRuleEntity.setUpdate();
// mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity);
// if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){
// for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) {
// mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i));
// }
// }
//}
//
//@Override
//@CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId")
//public void saveMdmModuleDbFiledsRule(String mdmId, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities) {
// MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity();
// mdmModuleDbFiledsRuleEntity.setMdmId(mdmId);
// mdmModuleDbFiledsRuleEntity.setSts("Y");
// mdmModuleDbFiledsRuleEntity.setUpdate();
// mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity);
// if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
// for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) {
// if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){
// mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i));
// }else {
// mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i));
// }
// }
// }
//}
//
//@Override
//@Cacheable(cacheNames="mdmModuleViewDetail",key = "#entity.mdmId")
//public List<MdmModuleViewDetailEntity> queryMdmModuleViewDetail(MdmModuleViewDetailEntity entity) {
// List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(entity);
// return mdmModuleViewDetailEntities;
//}
//
//@Override
//@Cacheable(cacheNames="mdmModuleView",key = "#entity.mdmId")
//public List<MdmModuleViewEntity> queryMdmModuleView(MdmModuleViewEntity entity) {
// List<MdmModuleViewEntity> moduleViewEntities = mdmModuleViewDao.queryBase(entity);
// return moduleViewEntities;
//}
//
//@Override
//@Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId")
//public List<MdmModuleViewButtonEntity> queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) {
// List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity);
// return mdmModuleViewButtonEntities;
//}
//
//@Override
//@CacheEvict(cacheNames="mdmModuleView",key = "#mdmId")
//public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) {
// mdmModuleViewDao.update(mdmModuleViewEntity);
//}
//
//@Override
//@CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId")
//public void saveMdmModuleViewDetail(String mdmId, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities) {
// MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity();
// mdmModuleViewDetailEntity.setMdmId(mdmId);
// mdmModuleViewDetailEntity.setUpdate();
// mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity);
// if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){
// for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) {
// if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){
// mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i));
// }else {
// mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i));
// }
// }
// }
//}
//
//@Override
//@CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId")
//public void saveMdmModuleViewButton(String mdmId, List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities) {
// MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity();
// mdmModuleViewButtonEntity.setMdmId(mdmId);
// mdmModuleViewButtonEntity.setUpdate();
// mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity);
// if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){
// for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) {
// if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){
// mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i));
// }else {
// mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i));
// }
// }
// }
//}
//
//@Override
//@Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId")
//public List<MdmModuleDistributeDetailEntity> queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){
// List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity);
// return mdmModuleDistributeDetailEntities;
//}
//
//@Override
//@CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId")
//public void saveMdmModuleDistribute(String mdmId, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities) {
// //先删除
// MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity();
// mdmModuleDistributeEntity.setMdmId(mdmId);
// mdmModuleDistributeEntity.setUpdate();
// mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity);
// //保存主数据
// if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) {
// for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) {
// MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i);
// moduleDistributeEntity.setMdmId(mdmId);
// if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) {
// moduleDistributeEntity.setUpdate();
// //修改
// mdmModuleDistributeDao.update(moduleDistributeEntity);
// } else {
// //新增
// moduleDistributeEntity.setCreate();
// mdmModuleDistributeDao.save(moduleDistributeEntity);
// }
// if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){
// for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) {
// MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1);
// mdmModuleDistributeDetailEntity.setMdmId(mdmId);
// mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId());
// if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) {
// mdmModuleDistributeDetailEntity.setUpdate();
// //修改
// mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity);
// } else {
// //新增
// mdmModuleDistributeDetailEntity.setCreate();
// mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity);
// }
// }
// }
// }
// }
//}
//
//@Override
//@Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId")
//public List<MdmModuleSourceEntity> queryMdmModuleSource(MdmModuleSourceEntity entity) {
// List<MdmModuleSourceEntity> mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity);
// return mdmModuleSourceEntities;
//}
//
//@Override
//@CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId")
//public void saveMdmModuleSource(String mdmId, List<MdmModuleSourceEntity> mdmModuleSourceEntities) {
// //先删除
// MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity();
// mdmModuleSourceEntity.setMdmId(mdmId);
// mdmModuleSourceEntity.setUpdate();
// mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity);
// //保存主数据
// if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) {
// for (int i = 0; i < mdmModuleSourceEntities.size(); i++) {
// MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i);
// mdmModuleSourceEntity1.setMdmId(mdmId);
// if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) {
// mdmModuleSourceEntity1.setUpdate();
// //修改
// mdmModuleSourceDao.update(mdmModuleSourceEntity1);
// } else {
// //新增
// mdmModuleSourceEntity1.setCreate();
// mdmModuleSourceDao.save(mdmModuleSourceEntity1);
// }
// }
// }
//}
@Override
@Cacheable(cacheNames="mdmModuleViewButton",key = "#entity.mdmId")
public List<MdmModuleViewButtonEntity> queryMdmModuleViewButton(MdmModuleViewButtonEntity entity) {
List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(entity);
return mdmModuleViewButtonEntities;
}
@Override
@CacheEvict(cacheNames="mdmModuleView",key = "#mdmId")
public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) {
mdmModuleViewDao.update(mdmModuleViewEntity);
}
@Override
@CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId")
public void saveMdmModuleViewDetail(String mdmId, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities) {
MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity();
mdmModuleViewDetailEntity.setMdmId(mdmId);
mdmModuleViewDetailEntity.setUpdate();
mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity);
if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){
for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) {
if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){
mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i));
}else {
mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i));
}
}
}
}
@Override
@CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId")
public void saveMdmModuleViewButton(String mdmId, List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities) {
MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity();
mdmModuleViewButtonEntity.setMdmId(mdmId);
mdmModuleViewButtonEntity.setUpdate();
mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity);
if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){
for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) {
if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){
mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i));
}else {
mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i));
}
}
}
}
@Override
@Cacheable(cacheNames="mdmModuleDistribute",key = "#mdmId")
public List<MdmModuleDistributeEntity> queryMdmModuleDistribute(String mdmId,MdmModuleDistributeEntity mdmModuleDistributeEntity) {
List<MdmModuleDistributeEntity> mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(mdmModuleDistributeEntity);
//查询模块下的应用列表
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity();
mdmModuleDistributeDetailEntity.setSts("Y");
mdmModuleDistributeDetailEntity.setMdmId(mdmId);
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
if(mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0){
for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) {
List<MdmModuleDistributeDetailEntity> moduleDistributeDetailEntities = new ArrayList<>();
if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){
for (int i1 = 0; i1 < mdmModuleDistributeDetailEntities.size(); i1++) {
if(mdmModuleDistributeEntities.get(i).getId().equals(mdmModuleDistributeDetailEntities.get(i1).getDistributeId())){
moduleDistributeDetailEntities.add(mdmModuleDistributeDetailEntities.get(i1));
}
}
}
mdmModuleDistributeEntities.get(i).setMdmModuleDistributeDetailEntities(moduleDistributeDetailEntities);
}
}
return mdmModuleDistributeEntities;
}
@Override
@Cacheable(cacheNames="mdmModuleDistributeDetail",key = "#entity.mdmId")
public List<MdmModuleDistributeDetailEntity> queryMdmModuleDistributeDetail(MdmModuleDistributeDetailEntity entity){
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(entity);
return mdmModuleDistributeDetailEntities;
}
@Override
@CacheEvict(cacheNames="mdmModuleDistribute",key = "#mdmId")
public void saveMdmModuleDistribute(String mdmId, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities) {
//先删除
MdmModuleDistributeEntity mdmModuleDistributeEntity = new MdmModuleDistributeEntity();
mdmModuleDistributeEntity.setMdmId(mdmId);
mdmModuleDistributeEntity.setUpdate();
mdmModuleDistributeDao.logicRemoveMultiCondition(mdmModuleDistributeEntity);
//保存主数据
if (mdmModuleDistributeEntities != null && mdmModuleDistributeEntities.size() > 0) {
for (int i = 0; i < mdmModuleDistributeEntities.size(); i++) {
MdmModuleDistributeEntity moduleDistributeEntity = mdmModuleDistributeEntities.get(i);
moduleDistributeEntity.setMdmId(mdmId);
if (moduleDistributeEntity.getId() != null && !"".equals(moduleDistributeEntity.getId())) {
moduleDistributeEntity.setUpdate();
//修改
mdmModuleDistributeDao.update(moduleDistributeEntity);
} else {
//新增
moduleDistributeEntity.setCreate();
mdmModuleDistributeDao.save(moduleDistributeEntity);
}
if(moduleDistributeEntity.getMdmModuleDistributeDetailEntities() != null && moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size() > 0){
for (int i1 = 0; i1 < moduleDistributeEntity.getMdmModuleDistributeDetailEntities().size(); i1++) {
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = moduleDistributeEntity.getMdmModuleDistributeDetailEntities().get(i1);
mdmModuleDistributeDetailEntity.setMdmId(mdmId);
mdmModuleDistributeDetailEntity.setDistributeId(moduleDistributeEntity.getId());
if (mdmModuleDistributeDetailEntity.getId() != null && !"".equals(mdmModuleDistributeDetailEntity.getId())) {
mdmModuleDistributeDetailEntity.setUpdate();
//修改
mdmModuleDistributeDetailDao.update(mdmModuleDistributeDetailEntity);
} else {
//新增
mdmModuleDistributeDetailEntity.setCreate();
mdmModuleDistributeDetailDao.save(mdmModuleDistributeDetailEntity);
}
}
}
}
}
}
@Override
@Cacheable(cacheNames="mdmModuleSource",key = "#entity.mdmId")
public List<MdmModuleSourceEntity> queryMdmModuleSource(MdmModuleSourceEntity entity) {
List<MdmModuleSourceEntity> mdmModuleSourceEntities = mdmModuleSourceDao.queryBase(entity);
return mdmModuleSourceEntities;
}
@Override
@CacheEvict(cacheNames="mdmModuleSource",key = "#mdmId")
public void saveMdmModuleSource(String mdmId, List<MdmModuleSourceEntity> mdmModuleSourceEntities) {
//先删除
MdmModuleSourceEntity mdmModuleSourceEntity = new MdmModuleSourceEntity();
mdmModuleSourceEntity.setMdmId(mdmId);
mdmModuleSourceEntity.setUpdate();
mdmModuleSourceDao.logicRemoveMultiCondition(mdmModuleSourceEntity);
//保存主数据
if (mdmModuleSourceEntities != null && mdmModuleSourceEntities.size() > 0) {
for (int i = 0; i < mdmModuleSourceEntities.size(); i++) {
MdmModuleSourceEntity mdmModuleSourceEntity1 = mdmModuleSourceEntities.get(i);
mdmModuleSourceEntity1.setMdmId(mdmId);
if (mdmModuleSourceEntity1.getId() != null && !"".equals(mdmModuleSourceEntity1.getId())) {
mdmModuleSourceEntity1.setUpdate();
//修改
mdmModuleSourceDao.update(mdmModuleSourceEntity1);
} else {
//新增
mdmModuleSourceEntity1.setCreate();
mdmModuleSourceDao.save(mdmModuleSourceEntity1);
}
}
}
}
}

View File

@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException;
import com.hzya.frame.datasource.DataSourceUtilProperties;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.entity.SysApplicationDatasourceDto;
import com.hzya.frame.util.AESUtil;
import org.slf4j.Logger;
@ -24,21 +24,20 @@ public class DsDataSourceUtil {
@Resource
private DataSource dataSource;
public void addDataSource(SysDataSourceEntity sysDataSourceVo) throws Exception {
public void addDataSource(SysApplicationDatabaseEntity sysDataSourceVo) throws Exception {
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
JSONObject defaultDataSourceProperties = new JSONObject();
defaultDataSourceProperties.put("datasource_code", sysDataSourceVo.getSourceCode());
defaultDataSourceProperties.put("source_url", sysDataSourceVo.getSourceUrl());
defaultDataSourceProperties.put("source_type", sysDataSourceVo.getSourceTypeName());
defaultDataSourceProperties.put("login_name", sysDataSourceVo.getLoginName());
defaultDataSourceProperties.put("password", sysDataSourceVo.getPassword());
defaultDataSourceProperties.put("password", AESUtil.decrypt(sysDataSourceVo.getPassword()));
defaultDataSourceProperties.put("db_name", sysDataSourceVo.getDbName());
logger.info("***初始化数据源-{}*********", sysDataSourceVo.getSourceName());
DruidDataSource dataSource = createDefaultDataSource(defaultDataSourceProperties);
ds.addDataSource(sysDataSourceVo.getSourceCode(), dataSource);
logger.info("***初始化数据源-{}成功:*********", sysDataSourceVo.getSourceName());
}
/**
* @param code
* @return boolean
@ -57,16 +56,16 @@ public class DsDataSourceUtil {
}
/**
* @param sysDataSourceVo
* @param sysApplicationDatabaseEntity
* @return boolean
* @Author lvleigang
* @Description 修改数据源
* @Date 11:40 上午 2023/9/6
**/
public void editDataSource(SysDataSourceEntity sysDataSourceVo) throws Exception {
public void editDataSource(SysApplicationDatabaseEntity sysApplicationDatabaseEntity) throws Exception {
//先删除后添加
removeDataSource(sysDataSourceVo.getSourceCode());
addDataSource(sysDataSourceVo);
removeDataSource(sysApplicationDatabaseEntity.getSourceCode());
addDataSource(sysApplicationDatabaseEntity);
}

View File

@ -1,24 +0,0 @@
package com.hzya.frame.sys.dataSource.dao;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo;
import java.util.List;
/**
* 数据源表(sys_data_source: table)表数据库访问层
*
* @author makejava
* @since 2023-09-05 16:07:01
*/
public interface ISysDataSourceDao extends IBaseDao<SysDataSourceEntity, String> {
List<SysDataSourceVo> queryVoList(SysDataSourceEntity entity);
int queryVoList_COUNT(SysDataSourceEntity entity);
Integer entity_count_not_id(SysDataSourceEntity checkEntity);
List<SysDataSourceVo> queryDSBase(SysDataSourceEntity entity);
}

View File

@ -1,47 +0,0 @@
package com.hzya.frame.sys.dataSource.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 数据源表(SysDataSource)表数据库访问层
*
* @author makejava
* @since 2023-09-05 16:07:03
*/
@Repository(value = "SysDataSourceDaoImpl")
public class SysDataSourceDaoImpl extends MybatisGenericDao<SysDataSourceEntity, String> implements ISysDataSourceDao{
@DS("master")
@Override
public List<SysDataSourceVo> queryVoList(SysDataSourceEntity entity) {
List<SysDataSourceVo> o = (List<SysDataSourceVo>) super.selectList(getSqlIdPrifx() + "queryVoList", entity);
return o;
}
@Override
public int queryVoList_COUNT(SysDataSourceEntity entity) {
int o = (int) super.selectOne(getSqlIdPrifx() + "queryVoList_COUNT", entity);
return o;
}
@Override
public Integer entity_count_not_id(SysDataSourceEntity entity) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "entity_count_not_id", entity);
return o;
}
@DS("master")
@Override
public List<SysDataSourceVo> queryDSBase(SysDataSourceEntity entity) {
List<SysDataSourceVo> o = (List<SysDataSourceVo>) super.selectList(getSqlIdPrifx() + "queryDSBase", entity);
return o;
}
}

View File

@ -1,168 +0,0 @@
package com.hzya.frame.sys.dataSource.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 数据源表(SysDataSource)实体类
*
* @author makejava
* @since 2023-09-05 16:07:06
*/
public class SysDataSourceEntity extends BaseEntity {
/** 数据源唯一编码 */
private String sourceCode;
/** 数据源名称 */
private String sourceName;
/** ip */
private String sourceIp;
/** 端口 */
private String sourcePort;
/** 数据库名称 */
private String dbName;
/** 数据源类型 1oracle 2sqlsever 3mysql */
private String sourceType;
/** 登录名 */
private String loginName;
/** 密码 */
private String password;
/** 选择oracle下服务名称 */
private String serviceName;
/** 使用状态1启用0锁定 */
private Integer useState;
/** 数据源状态 1校验成功0校验失败 */
private String dataState;
public String getSourceCode() {
return sourceCode;
}
public void setSourceCode(String sourceCode) {
this.sourceCode = sourceCode;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getSourceIp() {
return sourceIp;
}
public void setSourceIp(String sourceIp) {
this.sourceIp = sourceIp;
}
public String getSourcePort() {
return sourcePort;
}
public void setSourcePort(String sourcePort) {
this.sourcePort = sourcePort;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public Integer getUseState() {
return useState;
}
public void setUseState(Integer useState) {
this.useState = useState;
}
public String getSourceUrl() {
StringBuffer sourceUrl = new StringBuffer();
if(sourceType != null){
switch (sourceType) {
case "1": //oracle
//jdbc:oracle:thin:@60.204.132.91:1521:ORCL
sourceUrl.append("jdbc:oracle:thin:@").append(sourceIp).append(":").append(sourcePort).append(":").append(serviceName);
break;
case "2": //sqlsever
//jdbc:sqlserver://221.12.175.82:1433;DatabaseName=U8CLOUD;encrypt=false;trustServerCertificate=true
sourceUrl.append("jdbc:jtds:sqlserver://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append(";encrypt=false;trustServerCertificate=true");
break;
case "3": //mysql
//jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
sourceUrl.append("jdbc:mysql://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true");
break;
case "4": //dm
//jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8
sourceUrl.append("jdbc:dm://").append(sourceIp).append(":").append(sourcePort).append("?schema=").append(dbName).append("&characterEncoding=UTF-8");
break;
default:
}
}
return sourceUrl.toString();
}
public String getSourceTypeName() {
String sourceTypeName = null;
if(sourceType != null){
switch (sourceType) {
case "1": //oracle
sourceTypeName = "oracle";
break;
case "2": //sqlsever
sourceTypeName = "sqlServer";
break;
case "3": //mysql
sourceTypeName = "mysql";
break;
default:
}
}
return sourceTypeName;
}
public String getDataState() {
return dataState;
}
public void setDataState(String dataState) {
this.dataState = dataState;
}
}

View File

@ -1,484 +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.hzya.frame.sys.dataSource.dao.impl.SysDataSourceDaoImpl">
<resultMap id="get-SysDataSourceEntity-result" type="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="sourceCode" column="source_code" jdbcType="VARCHAR"/>
<result property="sourceName" column="source_name" jdbcType="VARCHAR"/>
<result property="sourceIp" column="source_ip" jdbcType="VARCHAR"/>
<result property="sourcePort" column="source_port" jdbcType="VARCHAR"/>
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="sourceType" column="source_type" jdbcType="VARCHAR"/>
<result property="loginName" column="login_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="serviceName" column="service_name" jdbcType="VARCHAR"/>
<result property="useState" column="use_state" jdbcType="INTEGER"/>
<result property="dataState" column="data_state" jdbcType="INTEGER"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id="SysDataSourceEntity_Base_Column_List">
id
,source_code
,source_name
,source_ip
,source_port
,db_name
,source_type
,login_name
,password
,service_name
,use_state
,data_state
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysDataSourceEntity-result"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
<include refid="SysDataSourceEntity_Base_Column_List"/>
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="sourceCode != null and sourceCode != ''">and source_code = #{sourceCode}</if>
<if test="sourceName != null and sourceName != ''">and source_name = #{sourceName}</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip = #{sourceIp}</if>
<if test="sourcePort != null and sourcePort != ''">and source_port = #{sourcePort}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="sourceType != null and sourceType != ''">and source_type = #{sourceType}</if>
<if test="loginName != null and loginName != ''">and login_name = #{loginName}</if>
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询 采用==查询 -->
<select id="entity_count_not_id" resultType="Integer"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
count(1)
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id != #{id}</if>
<if test="sourceCode != null and sourceCode != ''">and source_code = #{sourceCode}</if>
<if test="sourceName != null and sourceName != ''">and source_name = #{sourceName}</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip = #{sourceIp}</if>
<if test="sourcePort != null and sourcePort != ''">and source_port = #{sourcePort}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="sourceType != null and sourceType != ''">and source_type = #{sourceType}</if>
<if test="loginName != null and loginName != ''">and login_name = #{loginName}</if>
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
and sts='Y'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select count(1) from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="sourceCode != null and sourceCode != ''">and source_code = #{sourceCode}</if>
<if test="sourceName != null and sourceName != ''">and source_name = #{sourceName}</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip = #{sourceIp}</if>
<if test="sourcePort != null and sourcePort != ''">and source_port = #{sourcePort}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="sourceType != null and sourceType != ''">and source_type = #{sourceType}</if>
<if test="loginName != null and loginName != ''">and login_name = #{loginName}</if>
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SysDataSourceEntity-result"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
<include refid="SysDataSourceEntity_Base_Column_List"/>
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="sourceCode != null and sourceCode != ''">and source_code like concat('%',#{sourceCode},'%')</if>
<if test="sourceName != null and sourceName != ''">and source_name like concat('%',#{sourceName},'%')</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip like concat('%',#{sourceIp},'%')</if>
<if test="sourcePort != null and sourcePort != ''">and source_port like concat('%',#{sourcePort},'%')</if>
<if test="dbName != null and dbName != ''">and db_name like concat('%',#{dbName},'%')</if>
<if test="sourceType != null and sourceType != ''">and source_type like concat('%',#{sourceType},'%')</if>
<if test="loginName != null and loginName != ''">and login_name like concat('%',#{loginName},'%')</if>
<if test="password != null and password != ''">and password like concat('%',#{password},'%')</if>
<if test="serviceName != null and serviceName != ''">and service_name like concat('%',#{serviceName},'%')
</if>
<if test="useState != null">and use_state like concat('%',#{useState},'%')</if>
<if test="dataState != null">and data_state like concat('%',#{dataState},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="queryVoList" resultType="com.hzya.frame.sys.dataSource.entity.SysDataSourceVo"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
id,
source_code as sourceCode,
source_name as sourceName,
source_ip as sourceIp,
source_port as sourcePort,
db_name as dbName,
source_type as sourceType,
login_name as loginName,
password as password,
service_name as serviceName,
use_state as useState,
data_state as dataState
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="sourceCode != null and sourceCode != ''">and source_code like concat('%',#{sourceCode},'%')</if>
<if test="sourceName != null and sourceName != ''">and source_name like concat('%',#{sourceName},'%')</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip like concat('%',#{sourceIp},'%')</if>
<if test="sourcePort != null and sourcePort != ''">and source_port like concat('%',#{sourcePort},'%')</if>
<if test="dbName != null and dbName != ''">and db_name like concat('%',#{dbName},'%')</if>
<if test="sourceType != null and sourceType != ''">and source_type like concat('%',#{sourceType},'%')</if>
<if test="loginName != null and loginName != ''">and login_name like concat('%',#{loginName},'%')</if>
<if test="password != null and password != ''">and password like concat('%',#{password},'%')</if>
<if test="serviceName != null and serviceName != ''">and service_name like concat('%',#{serviceName},'%')
</if>
<if test="useState != null">and use_state like concat('%',#{useState},'%')</if>
<if test="dataState != null">and data_state like concat('%',#{dataState},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<select id="queryDSBase" resultType="com.hzya.frame.sys.dataSource.entity.SysDataSourceVo"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
id,
source_code as sourceCode,
source_name as sourceName,
source_ip as sourceIp,
source_port as sourcePort,
db_name as dbName,
source_type as sourceType,
login_name as loginName,
password as password,
service_name as serviceName,
use_state as useState,
data_state as dataState
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="sourceCode != null and sourceCode != ''">and source_code = #{sourceCode}</if>
<if test="sourceName != null and sourceName != ''">and source_name = #{sourceName}</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip = #{sourceIp}</if>
<if test="sourcePort != null and sourcePort != ''">and source_port = #{sourcePort}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="sourceType != null and sourceType != ''">and source_type = #{sourceType}</if>
<if test="loginName != null and loginName != ''">and login_name = #{loginName}</if>
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
<if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">and modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
and sts='Y'
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="queryVoList_COUNT" resultType="int" parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
count(*)
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="sourceCode != null and sourceCode != ''">and source_code like concat('%',#{sourceCode},'%')</if>
<if test="sourceName != null and sourceName != ''">and source_name like concat('%',#{sourceName},'%')</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip like concat('%',#{sourceIp},'%')</if>
<if test="sourcePort != null and sourcePort != ''">and source_port like concat('%',#{sourcePort},'%')</if>
<if test="dbName != null and dbName != ''">and db_name like concat('%',#{dbName},'%')</if>
<if test="sourceType != null and sourceType != ''">and source_type like concat('%',#{sourceType},'%')</if>
<if test="loginName != null and loginName != ''">and login_name like concat('%',#{loginName},'%')</if>
<if test="password != null and password != ''">and password like concat('%',#{password},'%')</if>
<if test="serviceName != null and serviceName != ''">and service_name like concat('%',#{serviceName},'%')
</if>
<if test="useState != null">and use_state like concat('%',#{useState},'%')</if>
<if test="dataState != null">and data_state like concat('%',#{dataState},'%')</if>
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
concat('%',#{create_user_id},'%')
</if>
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
concat('%',#{modify_user_id},'%')
</if>
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
and sts='Y'
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="SysDataSourceentity_list_or" resultMap="get-SysDataSourceEntity-result"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
select
<include refid="SysDataSourceEntity_Base_Column_List"/>
from sys_data_source
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">or id = #{id}</if>
<if test="sourceCode != null and sourceCode != ''">or source_code = #{sourceCode}</if>
<if test="sourceName != null and sourceName != ''">or source_name = #{sourceName}</if>
<if test="sourceIp != null and sourceIp != ''">or source_ip = #{sourceIp}</if>
<if test="sourcePort != null and sourcePort != ''">or source_port = #{sourcePort}</if>
<if test="dbName != null and dbName != ''">or db_name = #{dbName}</if>
<if test="sourceType != null and sourceType != ''">or source_type = #{sourceType}</if>
<if test="loginName != null and loginName != ''">or login_name = #{loginName}</if>
<if test="password != null and password != ''">or password = #{password}</if>
<if test="serviceName != null and serviceName != ''">or service_name = #{serviceName}</if>
<if test="useState != null">or use_state = #{useState}</if>
<if test="dataState != null">or data_state = #{dataState}</if>
<if test="sorts != null">or sorts = #{sorts}</if>
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
<if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="modify_time != null">or modify_time = #{modify_time}</if>
<if test="sts != null and sts != ''">or sts = #{sts}</if>
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity" keyProperty="id"
useGeneratedKeys="true">
insert into sys_data_source(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">id ,</if>
<if test="sourceCode != null and sourceCode != ''">source_code ,</if>
<if test="sourceName != null and sourceName != ''">source_name ,</if>
<if test="sourceIp != null and sourceIp != ''">source_ip ,</if>
<if test="sourcePort != null and sourcePort != ''">source_port ,</if>
<if test="dbName != null and dbName != ''">db_name ,</if>
<if test="sourceType != null and sourceType != ''">source_type ,</if>
<if test="loginName != null and loginName != ''">login_name ,</if>
<if test="password != null and password != ''">password ,</if>
<if test="serviceName != null and serviceName != ''">service_name ,</if>
<if test="useState != null">use_state ,</if>
<if test="dataState != null">data_state ,</if>
<if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
<if test="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
<if test="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''">org_id ,</if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''">#{id} ,</if>
<if test="sourceCode != null and sourceCode != ''">#{sourceCode} ,</if>
<if test="sourceName != null and sourceName != ''">#{sourceName} ,</if>
<if test="sourceIp != null and sourceIp != ''">#{sourceIp} ,</if>
<if test="sourcePort != null and sourcePort != ''">#{sourcePort} ,</if>
<if test="dbName != null and dbName != ''">#{dbName} ,</if>
<if test="sourceType != null and sourceType != ''">#{sourceType} ,</if>
<if test="loginName != null and loginName != ''">#{loginName} ,</if>
<if test="password != null and password != ''">#{password} ,</if>
<if test="serviceName != null and serviceName != ''">#{serviceName} ,</if>
<if test="useState != null">#{useState} ,</if>
<if test="dataState != null">#{dataState} ,</if>
<if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
<if test="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
<if test="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_data_source a WHERE a.sts
= 'Y' ),
</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name,
password, service_name, use_state, data_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.dataState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name,
password, service_name, use_state, data_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.sourceCode},#{entity.sourceName},#{entity.sourceIp},#{entity.sourcePort},#{entity.dbName},#{entity.sourceType},#{entity.loginName},#{entity.password},#{entity.serviceName},#{entity.useState},#{entity.dataState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
</foreach>
on duplicate key update
source_code = values(source_code),
source_name = values(source_name),
source_ip = values(source_ip),
source_port = values(source_port),
db_name = values(db_name),
source_type = values(source_type),
login_name = values(login_name),
password = values(password),
service_name = values(service_name),
use_state = values(use_state),
data_state = values(data_state),
sorts = values(sorts),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
sts = values(sts),
org_id = values(org_id)
</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
update sys_data_source set
<trim suffix="" suffixOverrides=",">
<if test="sourceCode != null and sourceCode != ''">source_code = #{sourceCode},</if>
<if test="sourceName != null and sourceName != ''">source_name = #{sourceName},</if>
<if test="sourceIp != null and sourceIp != ''">source_ip = #{sourceIp},</if>
<if test="sourcePort != null and sourcePort != ''">source_port = #{sourcePort},</if>
<if test="dbName != null and dbName != ''">db_name = #{dbName},</if>
<if test="sourceType != null and sourceType != ''">source_type = #{sourceType},</if>
<if test="loginName != null and loginName != ''">login_name = #{loginName},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="serviceName != null and serviceName != ''">service_name = #{serviceName},</if>
<if test="useState != null">use_state = #{useState},</if>
<if test="dataState != null">data_state = #{dataState},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null">modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''">sts = #{sts},</if>
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
update sys_data_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition"
parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity">
update sys_data_source set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and id = #{id}</if>
<if test="sourceCode != null and sourceCode != ''">and source_code = #{sourceCode}</if>
<if test="sourceName != null and sourceName != ''">and source_name = #{sourceName}</if>
<if test="sourceIp != null and sourceIp != ''">and source_ip = #{sourceIp}</if>
<if test="sourcePort != null and sourcePort != ''">and source_port = #{sourcePort}</if>
<if test="dbName != null and dbName != ''">and db_name = #{dbName}</if>
<if test="sourceType != null and sourceType != ''">and source_type = #{sourceType}</if>
<if test="loginName != null and loginName != ''">and login_name = #{loginName}</if>
<if test="password != null and password != ''">and password = #{password}</if>
<if test="serviceName != null and serviceName != ''">and service_name = #{serviceName}</if>
<if test="useState != null">and use_state = #{useState}</if>
<if test="dataState != null">and data_state = #{dataState}</if>
<if test="sorts != null">and sorts = #{sorts}</if>
<if test="sts != null and sts != ''">and sts = #{sts}</if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_data_source where id = #{id}
</delete>
</mapper>

View File

@ -1,162 +0,0 @@
package com.hzya.frame.sys.dataSource.entity;
import com.hzya.frame.web.exception.BaseSystemException;
public class SysDataSourceVo {
/** 主键ID */
private String id;
/** 数据源编码 */
private String sourceCode;
/** 数据源名称 */
private String sourceName;
/** ip */
private String sourceIp;
/** 端口 */
private String sourcePort;
/** 数据库名称 */
private String dbName;
/** 数据源类型 1oracle 2sqlsever 3mysql 4dm*/
private String sourceType;
/** 登录名 */
private String loginName;
/** 密码 */
private String password;
/** 选择oracle下服务名称 */
private String serviceName;
/** 使用状态1启用0锁定 */
private Integer useState;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSourceCode() {
return sourceCode;
}
public void setSourceCode(String sourceCode) {
this.sourceCode = sourceCode;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getSourceIp() {
return sourceIp;
}
public void setSourceIp(String sourceIp) {
this.sourceIp = sourceIp;
}
public String getSourcePort() {
return sourcePort;
}
public void setSourcePort(String sourcePort) {
this.sourcePort = sourcePort;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public Integer getUseState() {
return useState;
}
public void setUseState(Integer useState) {
this.useState = useState;
}
public String getSourceUrl() {
StringBuffer sourceUrl = new StringBuffer();
switch (sourceType) {
case "1": //oracle
//jdbc:oracle:thin:@60.204.132.91:1521:ORCL
sourceUrl.append("jdbc:oracle:thin:@").append(sourceIp).append(":").append(sourcePort).append(":").append(serviceName);
break;
case "2": //sqlsever
//jdbc:sqlserver://221.12.175.82:1433;DatabaseName=U8CLOUD;encrypt=false;trustServerCertificate=true
sourceUrl.append("jdbc:jtds:sqlserver://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append(";encrypt=false;trustServerCertificate=true");
break;
case "3": //mysql
//jdbc:mysql://hzya.ufyct.com:9096/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false
sourceUrl.append("jdbc:mysql://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false");
break;
case "4": //dm
//jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8
sourceUrl.append("jdbc:dm://").append(sourceIp).append(":").append(sourcePort).append("?schema=").append(dbName).append("&characterEncoding=UTF-8");
break;
default:
}
return sourceUrl.toString();
}
public String getSourceTypeName() {
String sourceTypeName = null;
switch (sourceType) {
case "1": //oracle
sourceTypeName = "oracle";
break;
case "2": //sqlsever
sourceTypeName = "sqlServer";
break;
case "3": //mysql
sourceTypeName = "mysql";
break;
case "4": //mysql
sourceTypeName = "dm";
break;
default:
}
return sourceTypeName;
}
}

View File

@ -1,74 +0,0 @@
package com.hzya.frame.sys.dataSource.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
/**
* 数据源表(SysDataSource)表服务接口
*
* @author makejava
* @since 2023-09-05 16:07:10
*/
public interface ISysDataSourceService extends IBaseService<SysDataSourceEntity, String>{
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询列表
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity queryList(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询列表
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity queryPage(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取数据
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity queryEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 新增数据
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity addEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改数据
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity editEntity(JSONObject jsonObject);
/**
* @param jsonObject
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除数据
* @Date 2:18 下午 2023/7/17
**/
JsonResultEntity deleteEntity(JSONObject jsonObject);
/**
* @Author lvleigang
* @Description 数据源测试接口 测试当前页面数据源是否配置正确
* @Date 2:08 下午 2023/9/23
* @param jsonObject
* @return
**/
JsonResultEntity testDatabase(JSONObject jsonObject);
}

View File

@ -1,256 +0,0 @@
package com.hzya.frame.sys.dataSource.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.serviceUtil.DsDataSourceUtil;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo;
import com.hzya.frame.sys.dataSource.service.ISysDataSourceService;
import com.hzya.frame.sysnew.application.entity.SysApplicationDatasourceDto;
import com.hzya.frame.util.AESUtil;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.Date;
import java.util.List;
/**
* 数据源表(SysDataSource)表服务实现类
*
* @author makejava
* @since 2023-09-05 16:07:13
*/
@Service(value = "sysDataSourceService")
public class SysDataSourceServiceImpl extends BaseService<SysDataSourceEntity, String> implements ISysDataSourceService {
private ISysDataSourceDao sysDataSourceDao;
@Resource
private DsDataSourceUtil dsDataSourceUtil;
@Autowired
public void setSysDataSourceDao(ISysDataSourceDao dao) {
this.sysDataSourceDao = dao;
this.dao = dao;
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询列表
* @Date 2:18 下午 2023/7/17
**/
@Override
public JsonResultEntity queryList(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
List<SysDataSourceVo> sysDataSourceEntities = sysDataSourceDao.queryVoList(entity);
return BaseResult.getSuccessMessageEntity("查询数据成功", sysDataSourceEntities);
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 查询列表
* @Date 2:18 下午 2023/7/17
**/
@Override
public JsonResultEntity queryPage(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
//判断分页
if(entity == null || entity.getPageNum() == null || entity.getPageSize() == null){
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
}
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
List<SysDataSourceVo> sysDataSourceEntities = sysDataSourceDao.queryVoList(entity);
if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){
for (int i = 0; i < sysDataSourceEntities.size(); i++) {
sysDataSourceEntities.get(i).setPassword(AESUtil.decrypt(sysDataSourceEntities.get(i).getPassword()));
}
}
PageInfo pageInfo = new PageInfo(sysDataSourceEntities);
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 获取数据
* @Date 2:18 下午 2023/7/17
**/
@Override
public JsonResultEntity queryEntity(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
//判断分页
if(entity == null || entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("请先传递请求主键");
}
SysDataSourceEntity sysDataSourceEntity = sysDataSourceDao.queryOne(entity);
sysDataSourceEntity.setPassword(AESUtil.decrypt(sysDataSourceEntity.getPassword()));
return BaseResult.getSuccessMessageEntity("查询数据成功", sysDataSourceEntity);
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 新增数据
* @Date 2:18 下午 2023/7/17
**/
@Override
public JsonResultEntity addEntity(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getSourceName() == null || "".equals(entity.getSourceName())){
return BaseResult.getFailureMessageEntity("请先输入数据源名称");
}
if(entity.getSourceCode() == null || "".equals(entity.getSourceCode())){
return BaseResult.getFailureMessageEntity("请先输入数据源编码");
}
SysDataSourceEntity checkEntity = new SysDataSourceEntity();
checkEntity.setSts("Y");
checkEntity.setSourceCode(entity.getSourceCode());
int checkCount = sysDataSourceDao.getCount(checkEntity);
if(checkCount > 0){
return BaseResult.getFailureMessageEntity("数据源编码已存在");
}
setCreate(entity);
if(entity.getUseState() == 1){
try {
dsDataSourceUtil.addDataSource(entity);
entity.setDataState("1");
} catch (Exception e) {
entity.setDataState("0");
//return BaseResult.getFailureMessageEntity("初始化数据源失败,请检查数据源配置是否正确");
}
}
entity.setPassword(AESUtil.encrypt(entity.getPassword()));
sysDataSourceDao.save(entity);
return BaseResult.getSuccessMessageEntity("保存数据源成功",entity.getId());
}
private void setCreate(SysDataSourceEntity entity) {
entity.setId(UUIDUtils.getUUID());
entity.setSts("Y");
entity.setCreate_user_id(StpUtil.getLoginIdAsString());
entity.setModify_user_id(StpUtil.getLoginIdAsString());
entity.setCreate_time(new Date());
entity.setModify_time(new Date());
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 修改数据
* @Date 2:18 下午 2023/7/17
**/
@Override
public JsonResultEntity editEntity(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
if(entity == null){
return BaseResult.getFailureMessageEntity("参数不允许为空");
}
if(entity.getId() == null || "".equals(entity.getId())){
return BaseResult.getFailureMessageEntity("系统错误");
}
if(entity.getSourceName() == null || "".equals(entity.getSourceName())){
return BaseResult.getFailureMessageEntity("请先输入数据源名称");
}
if(entity.getSourceCode() == null || "".equals(entity.getSourceCode())){
return BaseResult.getFailureMessageEntity("请先输入数据源编码");
}
SysDataSourceEntity checkEntity = new SysDataSourceEntity();
checkEntity.setSts("Y");
checkEntity.setId(entity.getId());
checkEntity.setSourceCode(entity.getSourceCode());
int checkCount = sysDataSourceDao.entity_count_not_id(checkEntity);
if(checkCount > 0){
return BaseResult.getFailureMessageEntity("接口编码已存在");
}
entity.setModify_user_id(StpUtil.getLoginIdAsString());
entity.setModify_time(new Date());
entity.setSts("Y");
if(entity.getUseState() == 1){
try {
dsDataSourceUtil.editDataSource(entity);
} catch (Exception e) {
//return BaseResult.getSuccessMessageEntity("修改数据源失败,请检查数据源配置是否正确");
}
}else {
try {
dsDataSourceUtil.removeDataSource(entity.getSourceCode());
} catch (Exception e) {
return BaseResult.getSuccessMessageEntity("修改数据源失败");
}
}
if(entity.getPassword() != null ){
entity.setPassword(AESUtil.encrypt(entity.getPassword()));
}
sysDataSourceDao.update(entity);
return BaseResult.getSuccessMessageEntity("修改数据源成功",entity.getId());
}
/**
* @param object
* @return
* @Author lvleigang
* @Description 数据源测试接口 测试当前页面数据源是否配置正确
* @Date 2:08 下午 2023/9/23
**/
@Override
public JsonResultEntity testDatabase(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("系统错误");
}
SysApplicationDatasourceDto sysApplicationDatasourceDto = new SysApplicationDatasourceDto();
sysApplicationDatasourceDto.setSourceType(entity.getSourceType());
sysApplicationDatasourceDto.setSourceUrl(entity.getSourceUrl());
sysApplicationDatasourceDto.setLoginName(entity.getLoginName());
sysApplicationDatasourceDto.setPassword(entity.getPassword());
if (dsDataSourceUtil.testConnection(sysApplicationDatasourceDto)) {
return BaseResult.getSuccessMessageEntity("测试连接数据源成功",true);
} else {
return BaseResult.getSuccessMessageEntity("测试连接数据源失败",false);
}
}
/**
* @param object
* @return com.hzya.frame.web.entity.JsonResultEntity
* @Author lvleigang
* @Description 删除数据
* @Date 2:18 下午 2023/7/17
**/
@Override
public JsonResultEntity deleteEntity(JSONObject object) {
SysDataSourceEntity entity = getData("jsonStr", object, SysDataSourceEntity.class);
//判断编码是否重复
if (entity == null) {
return BaseResult.getFailureMessageEntity("请先填写内容");
}
if (entity.getId() == null || "".equals(entity.getId())) {
return BaseResult.getFailureMessageEntity("请先选择数据");
}
SysDataSourceEntity deleteEntity = sysDataSourceDao.queryOne(entity);
//删除主表和明细表
entity.setModify_user_id(StpUtil.getLoginIdAsString());
entity.setModify_time(new Date());
entity.setSts("Y");
try {
dsDataSourceUtil.removeDataSource(deleteEntity.getSourceCode());
} catch (Exception e) {
return BaseResult.getSuccessMessageEntity("删除数据源失败");
}
sysDataSourceDao.logicRemoveMultiCondition(entity);
return BaseResult.getSuccessMessageEntity("删除成功");
}
}

View File

@ -1,15 +1,18 @@
package com.hzya.frame.sysnew.application.database.dao;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* 数据源表(sys_application_database: table)表数据库访问层
*
* @author makejava
* @since 2023-09-25 11:46:27
* @since 2024-06-16 21:49:26
*/
public interface ISysApplicationDatabaseDao extends IBaseDao<SysApplicationDatabaseEntity, String> {
List<SysApplicationDatabaseEntity> queryDSBase(SysApplicationDatabaseEntity entity);
}

View File

@ -1,17 +1,26 @@
package com.hzya.frame.sysnew.application.database.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* 数据源表(SysApplicationDatabase)表数据库访问层
*
* @author makejava
* @since 2023-09-25 11:46:31
* @since 2024-06-16 21:49:30
*/
@Repository(value = "SysApplicationDatabaseDaoImpl")
public class SysApplicationDatabaseDaoImpl extends MybatisGenericDao<SysApplicationDatabaseEntity, String> implements ISysApplicationDatabaseDao{
@DS("master")
@Override
public List<SysApplicationDatabaseEntity> queryDSBase(SysApplicationDatabaseEntity entity) {
List<SysApplicationDatabaseEntity> o = (List<SysApplicationDatabaseEntity>) super.selectList(getSqlIdPrifx() + "queryDSBase", entity);
return o;
}
}

View File

@ -6,22 +6,30 @@ import com.hzya.frame.web.entity.BaseEntity;
* 数据源表(SysApplicationDatabase)实体类
*
* @author makejava
* @since 2023-09-25 11:46:34
* @since 2024-06-16 21:49:31
*/
public class SysApplicationDatabaseEntity extends BaseEntity {
/** 应用id */
private String appId;
/** 数据源唯一编码 */
private String sourceCode;
/** 数据源名称 */
private String sourceName;
/** 数据源类型1、oracle 2、sqlServer3、mysql */
private String sourceType;
/** 实例地址 */
private String sourceUrl;
/** 账户 */
/** ip */
private String sourceIp;
/** 端口 */
private String sourcePort;
/** 登录名 */
private String loginName;
/** 密码 */
private String password;
/** 库名 */
private String dbName;
/** 选择oracle下服务名称 */
private String serviceName;
/** 数据源是否启用1、开启 2、关闭 */
private String dbStatus;
@ -34,6 +42,22 @@ public class SysApplicationDatabaseEntity extends BaseEntity {
this.appId = appId;
}
public String getSourceCode() {
return sourceCode;
}
public void setSourceCode(String sourceCode) {
this.sourceCode = sourceCode;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getSourceType() {
return sourceType;
}
@ -42,12 +66,20 @@ public class SysApplicationDatabaseEntity extends BaseEntity {
this.sourceType = sourceType;
}
public String getSourceUrl() {
return sourceUrl;
public String getSourceIp() {
return sourceIp;
}
public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
public void setSourceIp(String sourceIp) {
this.sourceIp = sourceIp;
}
public String getSourcePort() {
return sourcePort;
}
public void setSourcePort(String sourcePort) {
this.sourcePort = sourcePort;
}
public String getLoginName() {
@ -74,6 +106,14 @@ public class SysApplicationDatabaseEntity extends BaseEntity {
this.dbName = dbName;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public String getDbStatus() {
return dbStatus;
}
@ -81,6 +121,49 @@ public class SysApplicationDatabaseEntity extends BaseEntity {
public void setDbStatus(String dbStatus) {
this.dbStatus = dbStatus;
}
public String getSourceUrl() {
StringBuffer sourceUrl = new StringBuffer();
if(sourceType != null){
switch (sourceType) {
case "1": //oracle
//jdbc:oracle:thin:@60.204.132.91:1521:ORCL
sourceUrl.append("jdbc:oracle:thin:@").append(sourceIp).append(":").append(sourcePort).append(":").append(serviceName);
break;
case "2": //sqlsever
//jdbc:sqlserver://221.12.175.82:1433;DatabaseName=U8CLOUD;encrypt=false;trustServerCertificate=true
sourceUrl.append("jdbc:jtds:sqlserver://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append(";encrypt=false;trustServerCertificate=true");
break;
case "3": //mysql
//jdbc:mysql://hzya.ufyct.com:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
sourceUrl.append("jdbc:mysql://").append(sourceIp).append(":").append(sourcePort).append("/").append(dbName).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true");
break;
case "4": //dm
//jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&characterEncoding=UTF-8
sourceUrl.append("jdbc:dm://").append(sourceIp).append(":").append(sourcePort).append("?schema=").append(dbName).append("&characterEncoding=UTF-8");
break;
default:
}
}
return sourceUrl.toString();
}
public String getSourceTypeName() {
String sourceTypeName = null;
if(sourceType != null){
switch (sourceType) {
case "1": //oracle
sourceTypeName = "oracle";
break;
case "2": //sqlsever
sourceTypeName = "sqlServer";
break;
case "3": //mysql
sourceTypeName = "mysql";
break;
default:
}
}
return sourceTypeName;
}
}

View File

@ -5,44 +5,46 @@
<resultMap id="get-SysApplicationDatabaseEntity-result" type="com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
<result property="sourceCode" column="source_code" jdbcType="VARCHAR"/>
<result property="sourceName" column="source_name" jdbcType="VARCHAR"/>
<result property="sourceType" column="source_type" jdbcType="VARCHAR"/>
<result property="sourceUrl" column="source_url" jdbcType="VARCHAR"/>
<result property="sourceIp" column="source_ip" jdbcType="VARCHAR"/>
<result property="sourcePort" column="source_port" jdbcType="VARCHAR"/>
<result property="loginName" column="login_name" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
<result property="serviceName" column="service_name" jdbcType="VARCHAR"/>
<result property="dbStatus" column="db_status" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "SysApplicationDatabaseEntity_Base_Column_List">
id
,app_id
,source_code
,source_name
,source_type
,source_url
,source_ip
,source_port
,login_name
,password
,db_name
,service_name
,db_status
,sorts
,org_id
,sts
,create_time
,create_user_id
,modify_time
,create_time
,modify_user_id
,modify_time
,sts
,org_id
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-SysApplicationDatabaseEntity-result">
select
<include refid="SysApplicationDatabaseEntity_Base_Column_List" />
from sys_application_database where sts = 'Y' and id = #{id}
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-SysApplicationDatabaseEntity-result" parameterType = "com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity">
select
@ -51,19 +53,23 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="sourceCode != null and sourceCode != ''"> and source_code = #{sourceCode} </if>
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType} </if>
<if test="sourceUrl != null and sourceUrl != ''"> and source_url = #{sourceUrl} </if>
<if test="sourceIp != null and sourceIp != ''"> and source_ip = #{sourceIp} </if>
<if test="sourcePort != null and sourcePort != ''"> and source_port = #{sourcePort} </if>
<if test="loginName != null and loginName != ''"> and login_name = #{loginName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="serviceName != null and serviceName != ''"> and service_name = #{serviceName} </if>
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@ -76,19 +82,23 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="sourceCode != null and sourceCode != ''"> and source_code = #{sourceCode} </if>
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType} </if>
<if test="sourceUrl != null and sourceUrl != ''"> and source_url = #{sourceUrl} </if>
<if test="sourceIp != null and sourceIp != ''"> and source_ip = #{sourceIp} </if>
<if test="sourcePort != null and sourcePort != ''"> and source_port = #{sourcePort} </if>
<if test="loginName != null and loginName != ''"> and login_name = #{loginName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="serviceName != null and serviceName != ''"> and service_name = #{serviceName} </if>
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@ -103,19 +113,23 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
<if test="sourceCode != null and sourceCode != ''"> and source_code like concat('%',#{sourceCode},'%') </if>
<if test="sourceName != null and sourceName != ''"> and source_name like concat('%',#{sourceName},'%') </if>
<if test="sourceType != null and sourceType != ''"> and source_type like concat('%',#{sourceType},'%') </if>
<if test="sourceUrl != null and sourceUrl != ''"> and source_url like concat('%',#{sourceUrl},'%') </if>
<if test="sourceIp != null and sourceIp != ''"> and source_ip like concat('%',#{sourceIp},'%') </if>
<if test="sourcePort != null and sourcePort != ''"> and source_port like concat('%',#{sourcePort},'%') </if>
<if test="loginName != null and loginName != ''"> and login_name like concat('%',#{loginName},'%') </if>
<if test="password != null and password != ''"> and password like concat('%',#{password},'%') </if>
<if test="dbName != null and dbName != ''"> and db_name like concat('%',#{dbName},'%') </if>
<if test="serviceName != null and serviceName != ''"> and service_name like concat('%',#{serviceName},'%') </if>
<if test="dbStatus != null and dbStatus != ''"> and db_status like concat('%',#{dbStatus},'%') </if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@ -130,19 +144,23 @@
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> or id = #{id} </if>
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
<if test="sourceCode != null and sourceCode != ''"> or source_code = #{sourceCode} </if>
<if test="sourceName != null and sourceName != ''"> or source_name = #{sourceName} </if>
<if test="sourceType != null and sourceType != ''"> or source_type = #{sourceType} </if>
<if test="sourceUrl != null and sourceUrl != ''"> or source_url = #{sourceUrl} </if>
<if test="sourceIp != null and sourceIp != ''"> or source_ip = #{sourceIp} </if>
<if test="sourcePort != null and sourcePort != ''"> or source_port = #{sourcePort} </if>
<if test="loginName != null and loginName != ''"> or login_name = #{loginName} </if>
<if test="password != null and password != ''"> or password = #{password} </if>
<if test="dbName != null and dbName != ''"> or db_name = #{dbName} </if>
<if test="serviceName != null and serviceName != ''"> or service_name = #{serviceName} </if>
<if test="dbStatus != null and dbStatus != ''"> or db_status = #{dbStatus} </if>
<if test="sorts != null"> or sorts = #{sorts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
<if test="create_time != null"> or create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
and sts='Y'
</trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
@ -155,19 +173,23 @@
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="appId != null and appId != ''"> app_id , </if>
<if test="sourceCode != null and sourceCode != ''"> source_code , </if>
<if test="sourceName != null and sourceName != ''"> source_name , </if>
<if test="sourceType != null and sourceType != ''"> source_type , </if>
<if test="sourceUrl != null and sourceUrl != ''"> source_url , </if>
<if test="sourceIp != null and sourceIp != ''"> source_ip , </if>
<if test="sourcePort != null and sourcePort != ''"> source_port , </if>
<if test="loginName != null and loginName != ''"> login_name , </if>
<if test="password != null and password != ''"> password , </if>
<if test="dbName != null and dbName != ''"> db_name , </if>
<if test="serviceName != null and serviceName != ''"> service_name , </if>
<if test="dbStatus != null and dbStatus != ''"> db_status , </if>
<if test="sorts != null"> sorts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="create_time != null"> create_time , </if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="create_time != null"> create_time , </if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
<if test="modify_time != null"> modify_time , </if>
<if test="sts != null and sts != ''"> sts , </if>
<if test="org_id != null and org_id != ''"> org_id , </if>
<if test="sorts == null ">sorts,</if>
<if test="sts == null ">sts,</if>
</trim>
@ -175,19 +197,23 @@
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if>
<if test="appId != null and appId != ''"> #{appId} ,</if>
<if test="sourceCode != null and sourceCode != ''"> #{sourceCode} ,</if>
<if test="sourceName != null and sourceName != ''"> #{sourceName} ,</if>
<if test="sourceType != null and sourceType != ''"> #{sourceType} ,</if>
<if test="sourceUrl != null and sourceUrl != ''"> #{sourceUrl} ,</if>
<if test="sourceIp != null and sourceIp != ''"> #{sourceIp} ,</if>
<if test="sourcePort != null and sourcePort != ''"> #{sourcePort} ,</if>
<if test="loginName != null and loginName != ''"> #{loginName} ,</if>
<if test="password != null and password != ''"> #{password} ,</if>
<if test="dbName != null and dbName != ''"> #{dbName} ,</if>
<if test="serviceName != null and serviceName != ''"> #{serviceName} ,</if>
<if test="dbStatus != null and dbStatus != ''"> #{dbStatus} ,</if>
<if test="sorts != null"> #{sorts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="create_time != null"> #{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
<if test="modify_time != null"> #{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_database a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
@ -195,52 +221,58 @@
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_application_database(app_id, source_type, source_url, login_name, password, db_name, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts)
insert into sys_application_database(app_id, source_code, source_name, source_type, source_ip, source_port, login_name, password, db_name, service_name, db_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.appId},#{entity.sourceType},#{entity.sourceUrl},#{entity.loginName},#{entity.password},#{entity.dbName},#{entity.dbStatus},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y')
(#{entity.appId},#{entity.sourceCode},#{entity.sourceName},#{entity.sourceType},#{entity.sourceIp},#{entity.sourcePort},#{entity.loginName},#{entity.password},#{entity.dbName},#{entity.serviceName},#{entity.dbStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into sys_application_database(app_id, source_type, source_url, login_name, password, db_name, db_status, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id)
insert into sys_application_database(app_id, source_code, source_name, source_type, source_ip, source_port, login_name, password, db_name, service_name, db_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.appId},#{entity.sourceType},#{entity.sourceUrl},#{entity.loginName},#{entity.password},#{entity.dbName},#{entity.dbStatus},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id})
(#{entity.appId},#{entity.sourceCode},#{entity.sourceName},#{entity.sourceType},#{entity.sourceIp},#{entity.sourcePort},#{entity.loginName},#{entity.password},#{entity.dbName},#{entity.serviceName},#{entity.dbStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
</foreach>
on duplicate key update
app_id = values(app_id),
source_code = values(source_code),
source_name = values(source_name),
source_type = values(source_type),
source_url = values(source_url),
source_ip = values(source_ip),
source_port = values(source_port),
login_name = values(login_name),
password = values(password),
db_name = values(db_name),
service_name = values(service_name),
db_status = values(db_status),
sorts = values(sorts),
org_id = values(org_id),
sts = values(sts),
create_time = values(create_time),
create_user_id = values(create_user_id),
create_time = values(create_time),
modify_user_id = values(modify_user_id),
modify_time = values(modify_time),
modify_user_id = values(modify_user_id)</insert>
sts = values(sts),
org_id = values(org_id)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity" >
update sys_application_database set
<trim suffix="" suffixOverrides=",">
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
<if test="sourceCode != null and sourceCode != ''"> source_code = #{sourceCode},</if>
<if test="sourceName != null and sourceName != ''"> source_name = #{sourceName},</if>
<if test="sourceType != null and sourceType != ''"> source_type = #{sourceType},</if>
<if test="sourceUrl != null and sourceUrl != ''"> source_url = #{sourceUrl},</if>
<if test="sourceIp != null and sourceIp != ''"> source_ip = #{sourceIp},</if>
<if test="sourcePort != null and sourcePort != ''"> source_port = #{sourcePort},</if>
<if test="loginName != null and loginName != ''"> login_name = #{loginName},</if>
<if test="password != null and password != ''"> password = #{password},</if>
<if test="dbName != null and dbName != ''"> db_name = #{dbName},</if>
<if test="serviceName != null and serviceName != ''"> service_name = #{serviceName},</if>
<if test="dbStatus != null and dbStatus != ''"> db_status = #{dbStatus},</if>
<if test="sorts != null"> sorts = #{sorts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
<if test="create_time != null"> create_time = #{create_time},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
</trim>
where id = #{id}
</update>
@ -255,21 +287,52 @@ update sys_application_database set sts= 'N' ,modify_time = #{modify_time},modi
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="sourceCode != null and sourceCode != ''"> and source_code = #{sourceCode} </if>
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType} </if>
<if test="sourceUrl != null and sourceUrl != ''"> and source_url = #{sourceUrl} </if>
<if test="sourceIp != null and sourceIp != ''"> and source_ip = #{sourceIp} </if>
<if test="sourcePort != null and sourcePort != ''"> and source_port = #{sourcePort} </if>
<if test="loginName != null and loginName != ''"> and login_name = #{loginName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="serviceName != null and serviceName != ''"> and service_name = #{serviceName} </if>
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
and sts='Y'
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
delete from sys_application_database where id = #{id}
</delete>
<!-- 查询 采用==查询 -->
<select id="queryDSBase" resultMap="get-SysApplicationDatabaseEntity-result" parameterType = "com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity">
select
<include refid="SysApplicationDatabaseEntity_Base_Column_List" />
from sys_application_database
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
<if test="sourceCode != null and sourceCode != ''"> and source_code = #{sourceCode} </if>
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
<if test="sourceType != null and sourceType != ''"> and source_type = #{sourceType} </if>
<if test="sourceIp != null and sourceIp != ''"> and source_ip = #{sourceIp} </if>
<if test="sourcePort != null and sourcePort != ''"> and source_port = #{sourcePort} </if>
<if test="loginName != null and loginName != ''"> and login_name = #{loginName} </if>
<if test="password != null and password != ''"> and password = #{password} </if>
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
<if test="serviceName != null and serviceName != ''"> and service_name = #{serviceName} </if>
<if test="dbStatus != null and dbStatus != ''"> and db_status = #{dbStatus} </if>
<if test="sorts != null"> and sorts = #{sorts} </if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
<if test="create_time != null"> and create_time = #{create_time} </if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
and sts='Y'
</trim>
</select>
</mapper>

View File

@ -6,7 +6,7 @@ import com.hzya.frame.basedao.service.IBaseService;
* 数据源表(SysApplicationDatabase)表服务接口
*
* @author makejava
* @since 2023-09-25 11:46:39
* @since 2024-06-16 21:49:32
*/
public interface ISysApplicationDatabaseService extends IBaseService<SysApplicationDatabaseEntity, String>{
}

View File

@ -11,7 +11,7 @@ import com.hzya.frame.basedao.service.impl.BaseService;
* 数据源表(SysApplicationDatabase)表服务实现类
*
* @author makejava
* @since 2023-09-25 11:46:42
* @since 2024-06-16 21:49:33
*/
@Service(value = "sysApplicationDatabaseService")
public class SysApplicationDatabaseServiceImpl extends BaseService<SysApplicationDatabaseEntity, String> implements ISysApplicationDatabaseService {

View File

@ -551,14 +551,19 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
**/
@Override
public JsonResultEntity testDatabase(JSONObject object) {
SysApplicationDatasourceDto entity = getData("jsonStr", object, SysApplicationDatasourceDto.class);
SysApplicationDatabaseEntity entity = getData("jsonStr", object, SysApplicationDatabaseEntity.class);
if (entity == null) {
return BaseResult.getFailureMessageEntity("系统错误");
}
if (dsDataSourceUtil.testConnection(entity)) {
return BaseResult.getSuccessMessageEntity("测试连接数据源成功");
SysApplicationDatasourceDto sysApplicationDatasourceDto = new SysApplicationDatasourceDto();
sysApplicationDatasourceDto.setSourceType(entity.getSourceType());
sysApplicationDatasourceDto.setSourceUrl(entity.getSourceUrl());
sysApplicationDatasourceDto.setLoginName(entity.getLoginName());
sysApplicationDatasourceDto.setPassword(entity.getPassword());
if (dsDataSourceUtil.testConnection(sysApplicationDatasourceDto)) {
return BaseResult.getSuccessMessageEntity("测试连接数据源成功",true);
} else {
return BaseResult.getFailureMessageEntity("测试连接数据源失败,请检查数据源配置是否正确");
return BaseResult.getSuccessMessageEntity("测试连接数据源失败",false);
}
}
@ -573,7 +578,8 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
sysApplicationDatabaseDao.logicRemoveMultiCondition(detailEntity);
SysApplicationDatabaseEntity databaseEntity = entity.getDatabaseEntity();
if (databaseEntity != null) {
databaseEntity.setAppId(entity.getId());
databaseEntity.setPassword(AESUtil.encrypt(databaseEntity.getPassword()));
databaseEntity.setSts("Y");
databaseEntity.setSts("Y");
databaseEntity.setDbStatus(entity.getDbStatus());
databaseEntity.setModify_user_id(StpUtil.getLoginIdAsString());
@ -581,6 +587,19 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
if (databaseEntity.getId() != null && !"".equals(databaseEntity.getId())) {
//修改
sysApplicationDatabaseDao.update(databaseEntity);
if("1".equals(databaseEntity.getDbStatus())){
try {
dsDataSourceUtil.editDataSource(databaseEntity);
} catch (Exception e) {
//return BaseResult.getSuccessMessageEntity("修改数据源失败,请检查数据源配置是否正确");
}
}else {
try {
dsDataSourceUtil.removeDataSource(databaseEntity.getSourceCode());
} catch (Exception e) {
//return BaseResult.getSuccessMessageEntity("修改数据源失败");
}
}
} else {
//新增
databaseEntity.setId(UUIDUtils.getUUID());
@ -1442,6 +1461,7 @@ public class SysApplicationServiceImpl extends BaseService<SysApplicationEntity,
if (list != null && list.size() > 0) {
sysApplicationDatabaseEntity = list.get(0);
sysApplicationDatabaseEntity.setPassword(AESUtil.decrypt(sysApplicationDatabaseEntity.getPassword()));
} else {
sysApplicationDatabaseEntity = null;
}

View File

@ -3,6 +3,8 @@ package com.hzya.frame.sysnew.login.impl;
import cn.dev33.satoken.stp.SaTokenInfo;
import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sysnew.application.dao.ISysApplicationDao;
import com.hzya.frame.sysnew.application.entity.SysApplicationEntity;
import com.hzya.frame.sysnew.login.ILoginService;
import com.hzya.frame.sysnew.organ.dao.ISysOrganDao;
import com.hzya.frame.sysnew.organ.entity.SysOrganEntity;
@ -37,6 +39,8 @@ public class LoginServiceImpl implements ILoginService {
@Resource
private ISysOrganDao sysOrganDao;
@Resource
private ISysApplicationDao sysApplicationDao;
@Resource
private InterfaceCache interfaceCache;
/**
@ -111,6 +115,9 @@ public class LoginServiceImpl implements ILoginService {
res.put("token", token);
res.put("userInfo", sysUserEntity);
res.put("company", sysOrganEntities);
//切换数据源查询
return BaseResult.getSuccessMessageEntity("登录成功", res);
}

View File

@ -6,9 +6,8 @@ import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException;
import com.hzya.frame.datasource.DataSourceUtilProperties;
import com.hzya.frame.sys.dataSource.dao.ISysDataSourceDao;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity;
import com.hzya.frame.sys.dataSource.entity.SysDataSourceVo;
import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao;
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
import com.hzya.frame.util.AESUtil;
import com.hzya.frame.web.entity.BaseEntity;
import com.hzya.frame.web.exception.BaseSystemException;
@ -38,7 +37,7 @@ public class AopDynamicRoutingDataSourceInit {
@Resource
private DataSource dataSource;
@Resource
private ISysDataSourceDao sysDataSourceDao;
private ISysApplicationDatabaseDao sysApplicationDatabaseDao;
@Before("@annotation(dsAnnotation)")
@ -64,12 +63,12 @@ public class AopDynamicRoutingDataSourceInit {
dsDatasource = ds.getDataSource(dsValue);
} catch (CannotFindDataSourceException exception) {
//logger.info("beforeDynamicRoutingDataSourceInitMethod:根据ds获取dsDatasource失败异常信息" + "exception.getMessage()" + " 执行初始化数据源:" + dsValue);
SysDataSourceEntity entity = new SysDataSourceEntity();
SysApplicationDatabaseEntity entity = new SysApplicationDatabaseEntity();
entity.setSts("Y");
entity.setUseState(1);
entity.setDataState("1");
entity.setDbStatus("1");
entity.setSourceCode(dsValue);
List<SysDataSourceVo> sysDataSourceEntities = sysDataSourceDao.queryDSBase(entity);
entity.setDataSourceCode("master");
List<SysApplicationDatabaseEntity> sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(entity);
//logger.info("beforeDynamicRoutingDataSourceInitMethod:根据dsValue获取数据源信息查询结果 sysDataSourceEntities.size:" + sysDataSourceEntities.size());
if (sysDataSourceEntities != null && sysDataSourceEntities.size() > 0) {
for (int i = 0; i < sysDataSourceEntities.size(); i++) {