主数据新建类

This commit is contained in:
lvleigang 2024-06-03 13:39:48 +08:00
parent 2741e28ba1
commit 9aceb2f78b
27 changed files with 4302 additions and 79 deletions

View File

@ -0,0 +1,52 @@
package com.hzya.frame.mdm.entity;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import java.util.List;
public class MdmDto {
//主数据编码
private Long mdmCode;
//单据编码规则
private List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList;
//主数据主表
private MdmModuleDbEntity mainMdmModuleDb;
//主数据子表
private List<MdmModuleDbEntity> sublistMdmModuleDb;
public Long getMdmCode() {
return mdmCode;
}
public void setMdmCode(Long mdmCode) {
this.mdmCode = mdmCode;
}
public List<MdmTableCodeRuleEntity> getMdmTableCodeRuleEntityList() {
return mdmTableCodeRuleEntityList;
}
public void setMdmTableCodeRuleEntityList(List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList) {
this.mdmTableCodeRuleEntityList = mdmTableCodeRuleEntityList;
}
public MdmModuleDbEntity getMainMdmModuleDb() {
return mainMdmModuleDb;
}
public void setMainMdmModuleDb(MdmModuleDbEntity mainMdmModuleDb) {
this.mainMdmModuleDb = mainMdmModuleDb;
}
public List<MdmModuleDbEntity> getSublistMdmModuleDb() {
return sublistMdmModuleDb;
}
public void setSublistMdmModuleDb(List<MdmModuleDbEntity> sublistMdmModuleDb) {
this.sublistMdmModuleDb = sublistMdmModuleDb;
}
}

View File

@ -3,6 +3,9 @@ package com.hzya.frame.mdm.mdmModule.dao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
import java.util.Map;
/**
* 主数据模版(mdm_module: table)表数据库访问层
*
@ -11,5 +14,11 @@ import com.hzya.frame.basedao.dao.IBaseDao;
*/
public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
List<MdmModuleEntity> queryMdm(MdmModuleEntity entity);
MdmModuleEntity getByMdmCode(Long mdmCode);
Integer checkTable(Map<String, String> maps);
}

View File

@ -4,6 +4,10 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
import java.util.Map;
/**
* 主数据模版(MdmModule)表数据库访问层
*
@ -13,5 +17,23 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
@Repository(value = "MdmModuleDaoImpl")
public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String> implements IMdmModuleDao{
@Override
public List<MdmModuleEntity> queryMdm(MdmModuleEntity entity) {
List<MdmModuleEntity> o = (List<MdmModuleEntity>) super.selectList(getSqlIdPrifx() + "queryMdm", entity);
return o;
}
@Override
public MdmModuleEntity getByMdmCode(Long mdmCode) {
MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.query(getSqlIdPrifx() + "getByMdmCode",mdmCode);
return mdmModuleEntity;
}
@Override
public Integer checkTable(Map<String, String> maps) {
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "checkTable", maps);
return o;
}
}

View File

@ -22,6 +22,10 @@ public class MdmModuleEntity extends BaseEntity {
private String remark;
/** 公司id */
private String companyId;
//创建人
private String createUser;
//修改人
private String modifyUser;
public String getMdmName() {
@ -72,5 +76,20 @@ public class MdmModuleEntity extends BaseEntity {
this.companyId = companyId;
}
public String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
}

View File

@ -9,6 +9,8 @@
<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"/>
@ -35,6 +37,12 @@
,org_id
,company_id
</sql>
<!--通过ID获取数据 -->
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
select
<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
@ -138,13 +146,14 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity" keyProperty="id" useGeneratedKeys="true">
<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>
@ -155,7 +164,6 @@
<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(
@ -164,6 +172,7 @@
<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>
@ -174,13 +183,12 @@
<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 a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<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=",">
@ -188,7 +196,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<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=",">
@ -251,6 +259,51 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
<delete id="entity_delete">
delete from mdm_module where id = #{id}
</delete>
<!-- 分页查询列表 采用like格式 -->
<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,
a.mdm_logo as mdm_logo,
a.mdm_code as mdm_code,
a.mdm_type as mdm_type,
a.remark as remark,
a.create_time as create_time,
a.modify_time as modify_time,
d.person_name as createUser,
n.person_name as modifyUser
from
mdm_module a
LEFT JOIN sys_user c on c.id = a.create_user_id and c.sts = 'Y'
LEFT JOIN sys_person d on d.id = c.person_id and d.sts = 'Y'
LEFT JOIN sys_user m on m.id = a.modify_user_id and m.sts = 'Y'
LEFT JOIN sys_person n on n.id = m.person_id and n.sts = 'Y'
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">and a.id like concat('%',#{id},'%')</if>
<if test="mdmName != null and mdmName != ''">and a.mdm_name like concat('%',#{mdmName},'%')</if>
<if test="mdmCode != null ">and a.mdm_code like concat('%',#{mdmCode},'%')</if>
<if test="mdmType != null and mdmType != ''">and a.mdm_type = #{mdmType}</if>
<if test="remark != null and remark != ''">and a.remark like concat('%',#{remark},'%')</if>
and a.sts='Y'
</trim>
order by a.sorts asc
</select>
<!--通过ID获取数据 -->
<select id="getByMdmCode" resultMap="get-MdmModuleEntity-result">
select
<include refid="MdmModuleEntity_Base_Column_List" />
from mdm_module where mdm_code = #{ mdmCode } and sts='Y'
</select>
<!--通过ID获取数据 -->
<select id="checkTable" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = 'businesscenter'
and TABLE_NAME = #{tableName}
</select>
</mapper>

View File

@ -1,6 +1,10 @@
package com.hzya.frame.mdm.mdmModuleDb.entity;
import java.util.Date;
import java.util.List;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 模版数据库表(MdmModuleDb)实体类
@ -20,6 +24,9 @@ public class MdmModuleDbEntity extends BaseEntity {
private String remark;
/** 公司id */
private String companyId;
/** 数据类型 1、新增 2、修改 */
private String dataType;
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
public String getMdmId() {
@ -62,5 +69,20 @@ public class MdmModuleDbEntity extends BaseEntity {
this.companyId = companyId;
}
public List<MdmModuleDbFiledsEntity> getSublistMdmModuleDbFileds() {
return sublistMdmModuleDbFileds;
}
public void setSublistMdmModuleDbFileds(List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds) {
this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
}

View File

@ -132,7 +132,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity" keyProperty="id" useGeneratedKeys="true">
<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>
@ -148,7 +148,6 @@
<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(
@ -166,13 +165,12 @@
<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_db a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<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=",">
@ -180,7 +178,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<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=",">

View File

@ -1,6 +1,9 @@
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
import java.util.Date;
import java.util.List;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 模版数据库字段表(MdmModuleDbFileds)实体类
@ -36,7 +39,9 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
private String filedLength;
/** 公司id */
private String companyId;
/** 数据类型 1、新增 2、修改 */
private String dataType;
private List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules;
public String getMdmId() {
return mdmId;
@ -142,5 +147,20 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
this.companyId = companyId;
}
public List<MdmModuleDbFiledsRuleEntity> getMdmModuleDbFiledsRules() {
return mdmModuleDbFiledsRules;
}
public void setMdmModuleDbFiledsRules(List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRules) {
this.mdmModuleDbFiledsRules = mdmModuleDbFiledsRules;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
}

View File

@ -180,7 +180,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" keyProperty="id" useGeneratedKeys="true">
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
insert into mdm_module_db_fileds(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -204,7 +204,6 @@
<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(
@ -230,13 +229,12 @@
<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_db_fileds a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertBatch" >
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
@ -244,7 +242,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -28,7 +28,8 @@ public class MdmModuleDbFiledsRuleEntity extends BaseEntity {
private String ruleType;
/** 公司id */
private String companyId;
/** 数据类型 1、新增 2、修改 */
private String dataType;
public String getMdmId() {
return mdmId;
@ -102,5 +103,12 @@ public class MdmModuleDbFiledsRuleEntity extends BaseEntity {
this.companyId = companyId;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
}

View File

@ -156,7 +156,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" keyProperty="id" useGeneratedKeys="true">
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity" >
insert into mdm_module_db_fileds_rule(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -176,7 +176,6 @@
<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(
@ -198,13 +197,12 @@
<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_db_fileds_rule a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertBatch" >
insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
@ -212,7 +210,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_db_fileds_rule(mdm_id, form_name, db_id, filed_id, rule_name, rule_code, rule_value, rule_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -144,7 +144,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity" keyProperty="id" useGeneratedKeys="true">
<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>
@ -162,7 +162,6 @@
<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(
@ -182,13 +181,12 @@
<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" keyProperty="id" useGeneratedKeys="true">
<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)
values
<foreach collection="entities" item="entity" separator=",">
@ -196,7 +194,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<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)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -150,7 +150,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" keyProperty="id" useGeneratedKeys="true">
<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>
@ -169,7 +169,6 @@
<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(
@ -190,13 +189,12 @@
<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" keyProperty="id" useGeneratedKeys="true">
<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)
values
<foreach collection="entities" item="entity" separator=",">
@ -204,7 +202,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<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)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -132,7 +132,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity" keyProperty="id" useGeneratedKeys="true">
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity" >
insert into mdm_module_view(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -148,7 +148,6 @@
<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(
@ -166,13 +165,12 @@
<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_view a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertBatch" >
insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
@ -180,7 +178,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_view(mdm_id, view_name, view_filed, up_id_filed, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -132,7 +132,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity" keyProperty="id" useGeneratedKeys="true">
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity" >
insert into mdm_module_view_button(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -148,7 +148,6 @@
<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(
@ -166,13 +165,12 @@
<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_view_button a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertBatch" >
insert into mdm_module_view_button(mdm_id, view_id, button_type, button_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
@ -180,7 +178,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_view_button(mdm_id, view_id, button_type, button_value, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -132,7 +132,7 @@
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity" keyProperty="id" useGeneratedKeys="true">
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity" >
insert into mdm_module_view_detail(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
@ -148,7 +148,6 @@
<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(
@ -166,13 +165,12 @@
<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_view_detail a WHERE a.sts = 'Y' ),</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertBatch" >
insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
<foreach collection="entities" item="entity" separator=",">
@ -180,7 +178,7 @@
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
<insert id="entityInsertOrUpdateBatch" >
insert into mdm_module_view_detail(mdm_id, view_id, view_filed, view_type, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
values
<foreach collection="entities" item="entity" separator=",">

View File

@ -0,0 +1,15 @@
package com.hzya.frame.mdm.mdmTableCodeRule.dao;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* 模版数据表编码规则表(mdm_table_code_rule: table)表数据库访问层
*
* @author makejava
* @since 2024-06-03 10:56:13
*/
public interface IMdmTableCodeRuleDao extends IBaseDao<MdmTableCodeRuleEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.mdm.mdmTableCodeRule.dao.impl;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* 模版数据表编码规则表(MdmTableCodeRule)表数据库访问层
*
* @author makejava
* @since 2024-06-03 10:56:13
*/
@Repository(value = "MdmTableCodeRuleDaoImpl")
public class MdmTableCodeRuleDaoImpl extends MybatisGenericDao<MdmTableCodeRuleEntity, String> implements IMdmTableCodeRuleDao{
}

View File

@ -0,0 +1,86 @@
package com.hzya.frame.mdm.mdmTableCodeRule.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
/**
* 模版数据表编码规则表(MdmTableCodeRule)实体类
*
* @author makejava
* @since 2024-06-03 10:56:13
*/
public class MdmTableCodeRuleEntity extends BaseEntity {
/** 主数据模版ID */
private String mdmId;
/** db_id */
private String dbId;
/** 规则 */
private String dbName;
/** 类型 1、固定值 2、日期 3、流水 */
private String dbType;
/** 备注 */
private String remark;
/** 规则值 */
private String dbValue;
/** 公司id */
private String companyId;
public String getMdmId() {
return mdmId;
}
public void setMdmId(String mdmId) {
this.mdmId = mdmId;
}
public String getDbId() {
return dbId;
}
public void setDbId(String dbId) {
this.dbId = dbId;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = dbType;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDbValue() {
return dbValue;
}
public void setDbValue(String dbValue) {
this.dbValue = dbValue;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
}

View File

@ -0,0 +1,265 @@
<?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.mdm.mdmTableCodeRule.dao.impl.MdmTableCodeRuleDaoImpl">
<resultMap id="get-MdmTableCodeRuleEntity-result" type="com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="dbId" column="db_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="dbValue" column="db_value" 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 = "MdmTableCodeRuleEntity_Base_Column_List">
id
,mdm_id
,db_id
,db_name
,db_type
,remark
,db_value
,sorts
,create_user_id
,create_time
,modify_user_id
,modify_time
,sts
,org_id
,company_id
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmTableCodeRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity">
select
<include refid="MdmTableCodeRuleEntity_Base_Column_List" />
from mdm_table_code_rule
<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="dbId != null and dbId != ''"> and db_id = #{dbId} </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="dbValue != null and dbValue != ''"> and db_value = #{dbValue} </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.mdmTableCodeRule.entity.MdmTableCodeRuleEntity">
select count(1) from mdm_table_code_rule
<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="dbId != null and dbId != ''"> and db_id = #{dbId} </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="dbValue != null and dbValue != ''"> and db_value = #{dbValue} </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>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmTableCodeRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity">
select
<include refid="MdmTableCodeRuleEntity_Base_Column_List" />
from mdm_table_code_rule
<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="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </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="dbValue != null and dbValue != ''"> and db_value like concat('%',#{dbValue},'%') </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>
<!-- 查询列表 字段采用or格式 -->
<select id="MdmTableCodeRuleentity_list_or" resultMap="get-MdmTableCodeRuleEntity-result" parameterType = "com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity">
select
<include refid="MdmTableCodeRuleEntity_Base_Column_List" />
from mdm_table_code_rule
<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="dbId != null and dbId != ''"> or db_id = #{dbId} </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="dbValue != null and dbValue != ''"> or db_value = #{dbValue} </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>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity" >
insert into mdm_table_code_rule(
<trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
<if test="dbId != null and dbId != ''"> db_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="dbValue != null and dbValue != ''"> db_value , </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="dbId != null and dbId != ''"> #{dbId} ,</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="dbValue != null and dbValue != ''"> #{dbValue} ,</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_table_code_rule(mdm_id, db_id, db_name, db_type, remark, db_value, 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.dbId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.dbValue},#{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_table_code_rule(mdm_id, db_id, db_name, db_type, remark, db_value, 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.dbId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.dbValue},#{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_id = values(db_id),
db_name = values(db_name),
db_type = values(db_type),
remark = values(remark),
db_value = values(db_value),
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.mdmTableCodeRule.entity.MdmTableCodeRuleEntity" >
update mdm_table_code_rule set
<trim suffix="" suffixOverrides=",">
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</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="dbValue != null and dbValue != ''"> db_value = #{dbValue},</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.mdmTableCodeRule.entity.MdmTableCodeRuleEntity" >
update mdm_table_code_rule 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.mdmTableCodeRule.entity.MdmTableCodeRuleEntity" >
update mdm_table_code_rule 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="dbId != null and dbId != ''"> and db_id = #{dbId} </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="dbValue != null and dbValue != ''"> and db_value = #{dbValue} </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">
delete from mdm_table_code_rule where id = #{id}
</delete>
</mapper>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.mdm.mdmTableCodeRule.service;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* 模版数据表编码规则表(MdmTableCodeRule)表服务接口
*
* @author makejava
* @since 2024-06-03 10:56:13
*/
public interface IMdmTableCodeRuleService extends IBaseService<MdmTableCodeRuleEntity, String>{
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.mdm.mdmTableCodeRule.service.impl;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao;
import com.hzya.frame.mdm.mdmTableCodeRule.service.IMdmTableCodeRuleService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* 模版数据表编码规则表(MdmTableCodeRule)表服务实现类
*
* @author makejava
* @since 2024-06-03 10:56:13
*/
@Service(value = "mdmTableCodeRuleService")
public class MdmTableCodeRuleServiceImpl extends BaseService<MdmTableCodeRuleEntity, String> implements IMdmTableCodeRuleService {
private IMdmTableCodeRuleDao mdmTableCodeRuleDao;
@Autowired
public void setMdmTableCodeRuleDao(IMdmTableCodeRuleDao dao) {
this.mdmTableCodeRuleDao = dao;
this.dao = dao;
}
}

View File

@ -8,5 +8,261 @@ 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 queryMdmShow(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据查询所有字段
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmShowAll(JSONObject jsonObject);
///**
// * @Author lvleigang
// * @Description 查询模版数据list 或者 分页
// * @Date 1:33 下午 2023/7/12
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// **/
//JsonResultEntity queryTemplateData(JSONObject jsonObject);
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据列表显示 业务数据
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmShowData(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据业务数据
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmShowDistribute(JSONObject jsonObject);
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据业务数据树结构
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmShowTreeData(JSONObject jsonObject);
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据业务数据树结构
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmOptionData(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据详情 区分类型 新增修改查看
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmShowDetails(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据详情数据 区分类型 新增修改查看
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据详情数据修改
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity updateMdmShowDetailsData(JSONObject jsonObject);
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据详情数据新增
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity saveMdmShowDetailsData(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 主数据删除业务数据
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity deleteMdmShowDetailsData(JSONObject jsonObject);
//
///**
// * @param jsonObject
// * @return com.hzya.frame.web.entity.JsonResultEntity
// * @Author lvleigang
// * @Description 处理分发数据
// * @Date 9:40 上午 2023/10/18
// **/
//JsonResultEntity doMdmDistribute(JSONObject jsonObject);
}

View File

@ -0,0 +1,37 @@
package com.hzya.frame.mdm.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import java.util.List;
/**
* 主数据服务接口
*/
public interface IMdmServiceCache {
/**
* @Author lvleigang
* @Description 获取模版主表
* @Date 10:13 上午 2024/6/3
* @param mdmCode
* @return com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity
**/
MdmModuleEntity getMdmModuleEntity(Long mdmCode);
void updateMdmModuleEntity(MdmModuleEntity entity);
List<MdmTableCodeRuleEntity> queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity mdmTableCodeRuleEntity);
List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity queryDb);
List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled);
List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule);
}

View File

@ -0,0 +1,103 @@
package com.hzya.frame.mdm.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao;
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao;
import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao;
import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao;
import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao;
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
import com.hzya.frame.mdm.service.IMdmService;
import com.hzya.frame.mdm.service.IMdmServiceCache;
import com.hzya.frame.sysnew.integtationTask.entity.IntegrationTaskEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 主数据服务实现类
*/
@Service(value = "mdmServiceCache")
public class MdmServiceCache implements IMdmServiceCache {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource
private IMdmModuleDao mdmModuleDao;
@Resource
private IMdmModuleDbDao mdmModuleDbDao;
@Resource
private IMdmModuleDbFiledsDao mdmModuleDbFiledsDao;
@Resource
private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao;
@Resource
private IMdmModuleDistributeDao mdmModuleDistributeDao;
@Resource
private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao;
@Resource
private IMdmModuleViewDao mdmModuleViewDao;
@Resource
private IMdmModuleViewButtonDao mdmModuleViewButtonDao;
@Resource
private IMdmModuleViewDetailDao mdmModuleViewDetailDao;
@Resource
private IMdmTableCodeRuleDao mdmTableCodeRuleDao;
@Override
@Cacheable(cacheNames="mdmModule",key = "#mdmCode")
public MdmModuleEntity getMdmModuleEntity(Long mdmCode) {
MdmModuleEntity entity = mdmModuleDao.getByMdmCode(mdmCode);
return entity;
}
@Override
@CacheEvict(cacheNames="mdmModule",key = "#entity.mdmCode")
public void updateMdmModuleEntity(MdmModuleEntity entity) {
mdmModuleDao.update(entity);
}
@Override
@Cacheable(cacheNames="mdmTableCodeRule",key = "#mdmId")
public List<MdmTableCodeRuleEntity> queryMdmTableCodeRuleEntity(MdmTableCodeRuleEntity entity) {
List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntityList = mdmTableCodeRuleDao.queryBase(entity);
return mdmTableCodeRuleEntityList;
}
@Override
@Cacheable(cacheNames="mdmModuleDb",key = "#mdmId")
public List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity entity) {
List<MdmModuleDbEntity> mdmModuleDbEntities = mdmModuleDbDao.queryBase(entity);
return mdmModuleDbEntities;
}
@Override
@Cacheable(cacheNames="mdmModuleDbFileds",key = "#mdmId")
public List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity entity) {
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = mdmModuleDbFiledsDao.queryBase(entity);
return mdmModuleDbFiledsEntities;
}
@Override
@Cacheable(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId")
public List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity entity) {
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity);
return mdmModuleDbFiledsRuleEntities;
}
}

View File

@ -67,36 +67,36 @@ public class LoginServiceImpl implements ILoginService {
return BaseResult.getFailureMessageEntity("当前用户已停用,请先启用");
}
//校验当前登陆人是否有权限
boolean flag = false;
SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanNameloginServiceinterfacNamedoLogin");
if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){
return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
}
//查询用户权限
if(!flag){
SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+sysUserEntity.getId()+"interfaceId"+sysInterfaceEntity.getId());
if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){
flag = true;
}
}
//查询用户角色的权限
if(!flag){
List<SysUserRolesEntity> userRoleMap = (List<SysUserRolesEntity>) interfaceCache.get("3",null);
if(userRoleMap != null && userRoleMap.size() > 0){
for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) {
if(sysUserRolesEntity.getUserId().equals(sysUserEntity.getId())){
SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId());
if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){
flag = true;
break;
}
}
}
}
}
if(!flag){
return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
}
//boolean flag = false;
//SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanNameloginServiceinterfacNamedoLogin");
//if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){
// return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
//}
////查询用户权限
//if(!flag){
// SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+sysUserEntity.getId()+"interfaceId"+sysInterfaceEntity.getId());
// if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){
// flag = true;
// }
//}
////查询用户角色的权限
//if(!flag){
// List<SysUserRolesEntity> userRoleMap = (List<SysUserRolesEntity>) interfaceCache.get("3",null);
// if(userRoleMap != null && userRoleMap.size() > 0){
// for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) {
// if(sysUserRolesEntity.getUserId().equals(sysUserEntity.getId())){
// SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId());
// if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){
// flag = true;
// break;
// }
// }
// }
// }
//}
//if(!flag){
// return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员");
//}
//登录
StpUtil.login(sysUserEntity.getId());
//获取token