1、主数据新增字段时:系统主键、系统编码、系统名称的新增方法,修改方法优化。

This commit is contained in:
zhengyf 2025-06-10 10:28:07 +08:00
parent 8f20dc7668
commit 981f12d480
3 changed files with 426 additions and 350 deletions

View File

@ -1403,7 +1403,8 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity(); MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId()); mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
mdmModuleDbFiledsEntity.setSts("Y"); mdmModuleDbFiledsEntity.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity); // List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) { if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) {
for (int i = 0; i < mdmModuleDbFiledsEntityList.size(); i++) { for (int i = 0; i < mdmModuleDbFiledsEntityList.size(); i++) {
if (entity.getDbId().equals(mdmModuleDbFiledsEntityList.get(i).getDbId()) && entity.getEnName().equals(mdmModuleDbFiledsEntityList.get(i).getEnName())) { if (entity.getDbId().equals(mdmModuleDbFiledsEntityList.get(i).getDbId()) && entity.getEnName().equals(mdmModuleDbFiledsEntityList.get(i).getEnName())) {
@ -1411,26 +1412,35 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
} }
} }
} }
//查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09 //新增时查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
// boolean isSysPk = false; boolean isSysPk = false;
// boolean isSysCode = false; boolean isSysCode = false;
// boolean isSysName = false; boolean isSysName = false;
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) { for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
if ("Y".equals(dbFiledsEntity.getSysPk())) { if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
// isSysPk = true; if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改"); if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
} isSysPk = true;
if ("Y".equals(dbFiledsEntity.getSysCode())) { }
// isSysCode = true; if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改"); isSysCode = true;
} }
if ("Y".equals(dbFiledsEntity.getSysName())) { if ("Y".equals(dbFiledsEntity.getIsSysName())) {
// isSysName = true; isSysName = true;
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改"); }
}
} }
} }
//判端该字段是不是sysPk,sysCode,sysName=true
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
}
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改");
}
if ("Y".equals(entity.getIsSysName()) && isSysName) {
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改");
}
entity.setCreate(); entity.setCreate();
if ("1".equals(entity.getDbType())) { if ("1".equals(entity.getDbType())) {
entity.setAddType("1"); entity.setAddType("1");
@ -1508,6 +1518,42 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
} catch (Exception e) { } catch (Exception e) {
throw new BaseSystemException("表字段类型,修改失败,请联系管理员"); throw new BaseSystemException("表字段类型,修改失败,请联系管理员");
} }
//查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
mdmModuleDbFiledsEntity.setDbId(entity.getDbId());
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
mdmModuleDbFiledsEntity.setSts("Y");
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
boolean isSysPk = false;
boolean isSysCode = false;
boolean isSysName = false;
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
isSysPk = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
isSysCode = true;
}
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
isSysName = true;
}
}
}
}
//判端该字段是不是sysPk,sysCode,sysName=true
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
}
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
return BaseResult.getFailureMessageEntity("系统code字段已存在请修改");
}
if ("Y".equals(entity.getIsSysName()) && isSysName) {
return BaseResult.getFailureMessageEntity("系统name字段已存在请修改");
}
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = new ArrayList<>(); List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = new ArrayList<>();
mdmModuleDbFiledsEntities.add(entity); mdmModuleDbFiledsEntities.add(entity);
mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities); mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities);

View File

@ -220,38 +220,38 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
/** /**
* 是否sys主键 系统主键三方系统主键同步中台之后该字段作为主键Y/N * 是否sys主键 系统主键三方系统主键同步中台之后该字段作为主键Y/N
*/ */
private String sysPk; private String isSysPk;
/** /**
* 是否sys编码 系统code三方系统code同步中台之后该字段作为codeY/N * 是否sys编码 系统code三方系统code同步中台之后该字段作为codeY/N
*/ */
private String sysCode; private String isSysCode;
/** /**
* 是否sys名称 系统name三方系统name同步中台之后该字段作为nameY/N * 是否sys名称 系统name三方系统name同步中台之后该字段作为nameY/N
*/ */
private String sysName; private String isSysName;
public String getSysPk() { public String getIsSysPk() {
return sysPk; return isSysPk;
} }
public void setSysPk(String sysPk) { public void setIsSysPk(String isSysPk) {
this.sysPk = sysPk; this.isSysPk = isSysPk;
} }
public String getSysCode() { public String getIsSysCode() {
return sysCode; return isSysCode;
} }
public void setSysCode(String sysCode) { public void setIsSysCode(String isSysCode) {
this.sysCode = sysCode; this.isSysCode = isSysCode;
} }
public String getSysName() { public String getIsSysName() {
return sysName; return isSysName;
} }
public void setSysName(String sysName) { public void setIsSysName(String isSysName) {
this.sysName = sysName; this.isSysName = isSysName;
} }
} }

View File

@ -2,36 +2,37 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl"> <mapper namespace="com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl">
<resultMap id="get-MdmModuleDbFiledsEntity-result" type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" > <resultMap id="get-MdmModuleDbFiledsEntity-result"
<result property="id" column="id" jdbcType="VARCHAR"/> type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/> <result property="id" column="id" jdbcType="VARCHAR"/>
<result property="dbId" column="db_id" jdbcType="VARCHAR"/> <result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
<result property="chName" column="ch_name" jdbcType="VARCHAR"/> <result property="dbId" column="db_id" jdbcType="VARCHAR"/>
<result property="enName" column="en_name" jdbcType="VARCHAR"/> <result property="chName" column="ch_name" jdbcType="VARCHAR"/>
<result property="filedType" column="filed_type" jdbcType="VARCHAR"/> <result property="enName" column="en_name" jdbcType="VARCHAR"/>
<result property="addType" column="add_type" jdbcType="VARCHAR"/> <result property="filedType" column="filed_type" jdbcType="VARCHAR"/>
<result property="updateType" column="update_type" jdbcType="VARCHAR"/> <result property="addType" column="add_type" jdbcType="VARCHAR"/>
<result property="showType" column="show_type" jdbcType="VARCHAR"/> <result property="updateType" column="update_type" jdbcType="VARCHAR"/>
<result property="queryType" column="query_type" jdbcType="VARCHAR"/> <result property="showType" column="show_type" jdbcType="VARCHAR"/>
<result property="listType" column="list_type" jdbcType="VARCHAR"/> <result property="queryType" column="query_type" jdbcType="VARCHAR"/>
<result property="viewType" column="view_type" jdbcType="VARCHAR"/> <result property="listType" column="list_type" jdbcType="VARCHAR"/>
<result property="filedLength" column="filed_length" jdbcType="VARCHAR"/> <result property="viewType" column="view_type" jdbcType="VARCHAR"/>
<result property="sorts" column="sorts" jdbcType="INTEGER"/> <result property="filedLength" column="filed_length" jdbcType="VARCHAR"/>
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/> <result property="sorts" column="sorts" jdbcType="INTEGER"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/> <result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/> <result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/> <result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
<result property="sts" column="sts" jdbcType="VARCHAR"/> <result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
<result property="org_id" column="org_id" jdbcType="VARCHAR"/> <result property="sts" column="sts" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="VARCHAR"/> <result property="org_id" column="org_id" jdbcType="VARCHAR"/>
<result property="sysPk" column="sys_pk" jdbcType="VARCHAR"/> <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
<result property="sysCode" column="sys_code" jdbcType="VARCHAR"/> <result property="isSysPk" column="sys_pk" jdbcType="VARCHAR"/>
<result property="sysName" column="sys_name" jdbcType="VARCHAR"/> <result property="isSysCode" column="sys_code" jdbcType="VARCHAR"/>
</resultMap> <result property="isSysName" column="sys_name" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段--> <!-- 查询的字段-->
<sql id = "MdmModuleDbFiledsEntity_Base_Column_List"> <sql id="MdmModuleDbFiledsEntity_Base_Column_List">
id id
,mdm_id ,mdm_id
,db_id ,db_id
,ch_name ,ch_name
,en_name ,en_name
@ -54,316 +55,345 @@
,sys_pk ,sys_pk
,sys_code ,sys_code
,sys_name ,sys_name
</sql> </sql>
<!-- 查询 采用==查询 --> <!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity"> <select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result"
select parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" /> select
from mdm_module_db_fileds <include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
<trim prefix="where" prefixOverrides="and"> from mdm_module_db_fileds
<if test="id != null and id != ''"> and id = #{id} </if> <trim prefix="where" prefixOverrides="and">
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if> <if test="id != null and id != ''">and id = #{id}</if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if> <if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if> <if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if> <if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if> <if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if> <if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if> <if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if> <if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if> <if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if> <if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if> <if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if> <if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="sorts != null"> and sorts = #{sorts} </if> <if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if> <if test="sorts != null">and sorts = #{sorts}</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_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if> <if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if> <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if> <if test="modify_time != null">and modify_time = #{modify_time}</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="companyId != null and companyId != ''"> and company_id = #{companyId} </if> <if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="sysPk != null and sysPk != ''"> and sys_pk = #{sysPk} </if> <if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="sysCode != null and sysCode != ''"> and sys_code = #{sysCode} </if> <if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
<if test="sysName != null and sysName != ''"> and sys_name = #{sysName} </if> <if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
<if test="roletype != null and roletype != ''"> <if test="roletype != null and roletype != ''">
and id in ( and id in (
select select
filed_id filed_id
from mdm_module_db_fileds_rule from mdm_module_db_fileds_rule
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue} where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
) )
</if> </if>
and sts='Y' and sts='Y'
</trim> </trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> <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> <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select> </select>
<!-- 查询符合条件的数量 --> <!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity"> <select id="entity_count" resultType="Integer"
select count(1) from mdm_module_db_fileds parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<trim prefix="where" prefixOverrides="and"> select count(1) from mdm_module_db_fileds
<if test="id != null and id != ''"> and id = #{id} </if> <trim prefix="where" prefixOverrides="and">
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if> <if test="id != null and id != ''">and id = #{id}</if>
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if> <if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if> <if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
<if test="enName != null and enName != ''"> and en_name = #{enName} </if> <if test="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if> <if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="addType != null and addType != ''"> and add_type = #{addType} </if> <if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if> <if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="showType != null and showType != ''"> and show_type = #{showType} </if> <if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if> <if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="listType != null and listType != ''"> and list_type = #{listType} </if> <if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if> <if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if> <if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="sorts != null"> and sorts = #{sorts} </if> <if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if> <if test="sorts != null">and sorts = #{sorts}</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_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if> <if test="create_time != null">and create_time = #{create_time}</if>
<if test="modify_time != null"> and modify_time = #{modify_time} </if> <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
<if test="sts != null and sts != ''"> and sts = #{sts} </if> <if test="modify_time != null">and modify_time = #{modify_time}</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="companyId != null and companyId != ''"> and company_id = #{companyId} </if> <if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
<if test="sysPk != null and sysPk != ''"> and sys_pk = #{sysPk} </if> <if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
<if test="sysCode != null and sysCode != ''"> and sys_code = #{sysCode} </if> <if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
<if test="sysName != null and sysName != ''"> and sys_name = #{sysName} </if> <if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
and sts='Y' and sts='Y'
</trim> </trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> <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> <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select> </select>
<!-- 分页查询列表 采用like格式 --> <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity"> <select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result"
select parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" /> select
from mdm_module_db_fileds <include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
<trim prefix="where" prefixOverrides="and"> from mdm_module_db_fileds
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if> <trim prefix="where" prefixOverrides="and">
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if> <if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if> <if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
<if test="chName != null and chName != ''"> and ch_name like concat('%',#{chName},'%') </if> <if test="dbId != null and dbId != ''">and db_id like concat('%',#{dbId},'%')</if>
<if test="enName != null and enName != ''"> and en_name like concat('%',#{enName},'%') </if> <if test="chName != null and chName != ''">and ch_name like concat('%',#{chName},'%')</if>
<if test="filedType != null and filedType != ''"> and filed_type like concat('%',#{filedType},'%') </if> <if test="enName != null and enName != ''">and en_name like concat('%',#{enName},'%')</if>
<if test="addType != null and addType != ''"> and add_type like concat('%',#{addType},'%') </if> <if test="filedType != null and filedType != ''">and filed_type like concat('%',#{filedType},'%')</if>
<if test="updateType != null and updateType != ''"> and update_type like concat('%',#{updateType},'%') </if> <if test="addType != null and addType != ''">and add_type like concat('%',#{addType},'%')</if>
<if test="showType != null and showType != ''"> and show_type like concat('%',#{showType},'%') </if> <if test="updateType != null and updateType != ''">and update_type like concat('%',#{updateType},'%')</if>
<if test="queryType != null and queryType != ''"> and query_type like concat('%',#{queryType},'%') </if> <if test="showType != null and showType != ''">and show_type like concat('%',#{showType},'%')</if>
<if test="listType != null and listType != ''"> and list_type like concat('%',#{listType},'%') </if> <if test="queryType != null and queryType != ''">and query_type like concat('%',#{queryType},'%')</if>
<if test="viewType != null and viewType != ''"> and view_type like concat('%',#{viewType},'%') </if> <if test="listType != null and listType != ''">and list_type like concat('%',#{listType},'%')</if>
<if test="filedLength != null and filedLength != ''"> and filed_length like concat('%',#{filedLength},'%') </if> <if test="viewType != null and viewType != ''">and view_type like concat('%',#{viewType},'%')</if>
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if> <if test="filedLength != null and filedLength != ''">and filed_length like concat('%',#{filedLength},'%')
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if> </if>
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if> <if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if> <if test="create_user_id != null and create_user_id != ''">and create_user_id like
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if> concat('%',#{create_user_id},'%')
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if> </if>
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if> <if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </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>
<if test="sysPk != null and sysPk != ''"> and sys_pk like concat('%',#{sysPk},'%') </if> <if test="isSysPk != null and isSysPk != ''">and sys_pk like concat('%',#{isSysPk},'%')</if>
<if test="sysCode != null and sysCode != ''"> and sys_code like concat('%',#{sysCode},'%') </if> <if test="isSysCode != null and isSysCode != ''">and sys_code like concat('%',#{isSysCode},'%')</if>
<if test="sysName != null and sysName != ''"> and sys_name like concat('%',#{sysName},'%') </if> <if test="isSysName != null and isSysName != ''">and sys_name like concat('%',#{isSysName},'%')</if>
and sts='Y' and sts='Y'
</trim> </trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> <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> <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select> </select>
<!-- 查询列表 字段采用or格式 --> <!-- 查询列表 字段采用or格式 -->
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity"> <select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result"
select parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" /> select
from mdm_module_db_fileds <include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
<trim prefix="where" prefixOverrides="and"> from mdm_module_db_fileds
<if test="id != null and id != ''"> or id = #{id} </if> <trim prefix="where" prefixOverrides="and">
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if> <if test="id != null and id != ''">or id = #{id}</if>
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if> <if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
<if test="chName != null and chName != ''"> or ch_name = #{chName} </if> <if test="dbId != null and dbId != ''">or db_id = #{dbId}</if>
<if test="enName != null and enName != ''"> or en_name = #{enName} </if> <if test="chName != null and chName != ''">or ch_name = #{chName}</if>
<if test="filedType != null and filedType != ''"> or filed_type = #{filedType} </if> <if test="enName != null and enName != ''">or en_name = #{enName}</if>
<if test="addType != null and addType != ''"> or add_type = #{addType} </if> <if test="filedType != null and filedType != ''">or filed_type = #{filedType}</if>
<if test="updateType != null and updateType != ''"> or update_type = #{updateType} </if> <if test="addType != null and addType != ''">or add_type = #{addType}</if>
<if test="showType != null and showType != ''"> or show_type = #{showType} </if> <if test="updateType != null and updateType != ''">or update_type = #{updateType}</if>
<if test="queryType != null and queryType != ''"> or query_type = #{queryType} </if> <if test="showType != null and showType != ''">or show_type = #{showType}</if>
<if test="listType != null and listType != ''"> or list_type = #{listType} </if> <if test="queryType != null and queryType != ''">or query_type = #{queryType}</if>
<if test="viewType != null and viewType != ''"> or view_type = #{viewType} </if> <if test="listType != null and listType != ''">or list_type = #{listType}</if>
<if test="filedLength != null and filedLength != ''"> or filed_length = #{filedLength} </if> <if test="viewType != null and viewType != ''">or view_type = #{viewType}</if>
<if test="sorts != null"> or sorts = #{sorts} </if> <if test="filedLength != null and filedLength != ''">or filed_length = #{filedLength}</if>
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if> <if test="sorts != null">or sorts = #{sorts}</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_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if> <if test="create_time != null">or create_time = #{create_time}</if>
<if test="modify_time != null"> or modify_time = #{modify_time} </if> <if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
<if test="sts != null and sts != ''"> or sts = #{sts} </if> <if test="modify_time != null">or modify_time = #{modify_time}</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="companyId != null and companyId != ''"> or company_id = #{companyId} </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>
<if test="sysPk != null and sysPk != ''"> or sys_pk = #{sysPk} </if> <if test="isSysPk != null and isSysPk != ''">or sys_pk = #{isSysPk}</if>
<if test="sysCode != null and sysCode != ''"> or sys_code = #{sysCode} </if> <if test="isSysCode != null and isSysCode != ''">or sys_code = #{isSysCode}</if>
<if test="sysName != null and sysName != ''"> or sys_name = #{sysName} </if> <if test="isSysName != null and isSysName != ''">or sys_name = #{isSysName}</if>
and sts='Y' and sts='Y'
</trim> </trim>
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> <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> <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select> </select>
<!--新增所有列--> <!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" > <insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
insert into mdm_module_db_fileds( insert into mdm_module_db_fileds(
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> id , </if> <if test="id != null and id != ''">id ,</if>
<if test="mdmId != null and mdmId != ''"> mdm_id , </if> <if test="mdmId != null and mdmId != ''">mdm_id ,</if>
<if test="dbId != null and dbId != ''"> db_id , </if> <if test="dbId != null and dbId != ''">db_id ,</if>
<if test="chName != null and chName != ''"> ch_name , </if> <if test="chName != null and chName != ''">ch_name ,</if>
<if test="enName != null and enName != ''"> en_name , </if> <if test="enName != null and enName != ''">en_name ,</if>
<if test="filedType != null and filedType != ''"> filed_type , </if> <if test="filedType != null and filedType != ''">filed_type ,</if>
<if test="addType != null and addType != ''"> add_type , </if> <if test="addType != null and addType != ''">add_type ,</if>
<if test="updateType != null and updateType != ''"> update_type , </if> <if test="updateType != null and updateType != ''">update_type ,</if>
<if test="showType != null and showType != ''"> show_type , </if> <if test="showType != null and showType != ''">show_type ,</if>
<if test="queryType != null and queryType != ''"> query_type , </if> <if test="queryType != null and queryType != ''">query_type ,</if>
<if test="listType != null and listType != ''"> list_type , </if> <if test="listType != null and listType != ''">list_type ,</if>
<if test="viewType != null and viewType != ''"> view_type , </if> <if test="viewType != null and viewType != ''">view_type ,</if>
<if test="filedLength != null and filedLength != ''"> filed_length , </if> <if test="filedLength != null and filedLength != ''">filed_length ,</if>
<if test="sorts != null"> sorts , </if> <if test="sorts != null">sorts ,</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </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="create_time != null">create_time ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </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="modify_time != null">modify_time ,</if>
<if test="sts != null and sts != ''"> sts , </if> <if test="sts != null and sts != ''">sts ,</if>
<if test="org_id != null and org_id != ''"> org_id , </if> <if test="org_id != null and org_id != ''">org_id ,</if>
<if test="companyId != null and companyId != ''"> company_id , </if> <if test="companyId != null and companyId != ''">company_id ,</if>
<if test="sysPk != null and sysPk != ''"> sys_pk , </if> <if test="isSysPk != null and isSysPk != ''">sys_pk ,</if>
<if test="sysCode != null and sysCode != ''"> sys_code , </if> <if test="isSysCode != null and isSysCode != ''">sys_code ,</if>
<if test="sysName != null and sysName != ''"> sys_name , </if> <if test="isSysName != null and isSysName != ''">sys_name ,</if>
<if test="sts == null ">sts,</if> <if test="sts == null ">sts,</if>
</trim> </trim>
)values( )values(
<trim suffix="" suffixOverrides=","> <trim suffix="" suffixOverrides=",">
<if test="id != null and id != ''"> #{id} ,</if> <if test="id != null and id != ''">#{id} ,</if>
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if> <if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
<if test="dbId != null and dbId != ''"> #{dbId} ,</if> <if test="dbId != null and dbId != ''">#{dbId} ,</if>
<if test="chName != null and chName != ''"> #{chName} ,</if> <if test="chName != null and chName != ''">#{chName} ,</if>
<if test="enName != null and enName != ''"> #{enName} ,</if> <if test="enName != null and enName != ''">#{enName} ,</if>
<if test="filedType != null and filedType != ''"> #{filedType} ,</if> <if test="filedType != null and filedType != ''">#{filedType} ,</if>
<if test="addType != null and addType != ''"> #{addType} ,</if> <if test="addType != null and addType != ''">#{addType} ,</if>
<if test="updateType != null and updateType != ''"> #{updateType} ,</if> <if test="updateType != null and updateType != ''">#{updateType} ,</if>
<if test="showType != null and showType != ''"> #{showType} ,</if> <if test="showType != null and showType != ''">#{showType} ,</if>
<if test="queryType != null and queryType != ''"> #{queryType} ,</if> <if test="queryType != null and queryType != ''">#{queryType} ,</if>
<if test="listType != null and listType != ''"> #{listType} ,</if> <if test="listType != null and listType != ''">#{listType} ,</if>
<if test="viewType != null and viewType != ''"> #{viewType} ,</if> <if test="viewType != null and viewType != ''">#{viewType} ,</if>
<if test="filedLength != null and filedLength != ''"> #{filedLength} ,</if> <if test="filedLength != null and filedLength != ''">#{filedLength} ,</if>
<if test="sorts != null"> #{sorts} ,</if> <if test="sorts != null">#{sorts} ,</if>
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</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="create_time != null">#{create_time} ,</if>
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</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="modify_time != null">#{modify_time} ,</if>
<if test="sts != null and sts != ''"> #{sts} ,</if> <if test="sts != null and sts != ''">#{sts} ,</if>
<if test="org_id != null and org_id != ''"> #{org_id} ,</if> <if test="org_id != null and org_id != ''">#{org_id} ,</if>
<if test="companyId != null and companyId != ''"> #{companyId} ,</if> <if test="companyId != null and companyId != ''">#{companyId} ,</if>
<if test="sysPk != null and sysPk != ''"> #{sysPk} ,</if> <if test="isSysPk != null and isSysPk != ''">#{isSysPk} ,</if>
<if test="sysCode != null and sysCode != ''"> #{sysCode} ,</if> <if test="isSysCode != null and isSysCode != ''">#{isSysCode} ,</if>
<if test="sysName != null and sysName != ''"> #{sysName} ,</if> <if test="isSysName != null and isSysName != ''">#{isSysName} ,</if>
<if test="sts == null ">'Y',</if> <if test="sts == null ">'Y',</if>
</trim> </trim>
) )
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="entityInsertBatch" > <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) insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
values query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
<foreach collection="entities" item="entity" separator=","> org_id, company_id, sts)
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y') values
</foreach> <foreach collection="entities" item="entity" separator=",">
</insert> (#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
<!-- 批量新增或者修改--> 'Y')
<insert id="entityInsertOrUpdateBatch" > </foreach>
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) </insert>
values <!-- 批量新增或者修改-->
<foreach collection="entities" item="entity" separator=","> <insert id="entityInsertOrUpdateBatch">
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}) insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
</foreach> query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
on duplicate key update org_id, company_id)
mdm_id = values(mdm_id), values
db_id = values(db_id), <foreach collection="entities" item="entity" separator=",">
ch_name = values(ch_name), (#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
en_name = values(en_name), </foreach>
filed_type = values(filed_type), on duplicate key update
add_type = values(add_type), mdm_id = values(mdm_id),
update_type = values(update_type), db_id = values(db_id),
show_type = values(show_type), ch_name = values(ch_name),
query_type = values(query_type), en_name = values(en_name),
list_type = values(list_type), filed_type = values(filed_type),
view_type = values(view_type), add_type = values(add_type),
filed_length = values(filed_length), update_type = values(update_type),
create_user_id = values(create_user_id), show_type = values(show_type),
create_time = values(create_time), query_type = values(query_type),
modify_user_id = values(modify_user_id), list_type = values(list_type),
modify_time = values(modify_time), view_type = values(view_type),
sts = values(sts), filed_length = values(filed_length),
org_id = values(org_id), create_user_id = values(create_user_id),
company_id = values(company_id)</insert> create_time = values(create_time),
<!--通过主键修改方法--> modify_user_id = values(modify_user_id),
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" > modify_time = values(modify_time),
update mdm_module_db_fileds set sts = values(sts),
<trim suffix="" suffixOverrides=","> org_id = values(org_id),
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if> company_id = values(company_id)
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if> </insert>
<if test="chName != null and chName != ''"> ch_name = #{chName},</if> <!--通过主键修改方法-->
<if test="enName != null and enName != ''"> en_name = #{enName},</if> <update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<if test="filedType != null and filedType != ''"> filed_type = #{filedType},</if> update mdm_module_db_fileds set
<if test="addType != null and addType != ''"> add_type = #{addType},</if> <trim suffix="" suffixOverrides=",">
<if test="updateType != null and updateType != ''"> update_type = #{updateType},</if> <if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
<if test="showType != null and showType != ''"> show_type = #{showType},</if> <if test="dbId != null and dbId != ''">db_id = #{dbId},</if>
<if test="queryType != null and queryType != ''"> query_type = #{queryType},</if> <if test="chName != null and chName != ''">ch_name = #{chName},</if>
<if test="listType != null and listType != ''"> list_type = #{listType},</if> <if test="enName != null and enName != ''">en_name = #{enName},</if>
<if test="viewType != null and viewType != ''"> view_type = #{viewType},</if> <if test="filedType != null and filedType != ''">filed_type = #{filedType},</if>
filed_length = #{filedLength}, <if test="addType != null and addType != ''">add_type = #{addType},</if>
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if> <if test="updateType != null and updateType != ''">update_type = #{updateType},</if>
<if test="create_time != null"> create_time = #{create_time},</if> <if test="showType != null and showType != ''">show_type = #{showType},</if>
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if> <if test="queryType != null and queryType != ''">query_type = #{queryType},</if>
<if test="modify_time != null"> modify_time = #{modify_time},</if> <if test="listType != null and listType != ''">list_type = #{listType},</if>
<if test="sts != null and sts != ''"> sts = #{sts},</if> <if test="viewType != null and viewType != ''">view_type = #{viewType},</if>
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if> filed_length = #{filedLength},
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if> <if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
</trim> <if test="create_time != null">create_time = #{create_time},</if>
where id = #{id} <if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
</update> <if test="modify_time != null">modify_time = #{modify_time},</if>
<!-- 逻辑删除 --> <if test="sts != null and sts != ''">sts = #{sts},</if>
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" > <if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} <if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
where id = #{id} <if test="isSysPk != null and isSysPk != ''">sys_pk = #{isSysPk},</if>
</update> <if test="isSysPk == null ">sys_pk = null,</if>
<!-- 多条件逻辑删除 --> <if test="isSysCode != null and isSysCode != ''">sys_code = #{isSysCode},</if>
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" > <if test="isSysCode == null ">sys_code = null,</if>
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} <if test="isSysName != null and isSysName != ''">sys_name = #{isSysName},</if>
<trim prefix="where" prefixOverrides="and"> <if test="isSysName == null ">sys_name = null,</if>
<if test="id != null and id != ''"> and id = #{id} </if> </trim>
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if> where id = #{id}
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if> </update>
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if> <!-- 逻辑删除 -->
<if test="enName != null and enName != ''"> and en_name = #{enName} </if> <update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if> update mdm_module_db_fileds
<if test="addType != null and addType != ''"> and add_type = #{addType} </if> set sts= 'N',
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if> modify_time = #{modify_time},
<if test="showType != null and showType != ''"> and show_type = #{showType} </if> modify_user_id = #{modify_user_id}
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if> where id = #{id}
<if test="listType != null and listType != ''"> and list_type = #{listType} </if> </update>
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if> <!-- 多条件逻辑删除 -->
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if> <update id="entity_logicDelete_Multi_Condition"
<if test="sorts != null"> and sorts = #{sorts} </if> parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
<if test="sts != null and sts != ''"> and sts = #{sts} </if> update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if> <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="chName != null and chName != ''">and ch_name = #{chName}</if>
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</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' and sts='Y'
</trim> </trim>
</update> </update>
<!--通过主键删除--> <!--通过主键删除-->
<delete id="entity_delete"> <delete id="entity_delete">
delete from mdm_module_db_fileds where id = #{id} delete
</delete> from mdm_module_db_fileds
where id = #{id}
</delete>
<!--通过mdmCode删除--> <!--通过mdmCode删除-->
<delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity"> <delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
delete from mdm_module_db_fileds where mdm_id = #{mdmId} delete
</delete> from mdm_module_db_fileds
where mdm_id = #{mdmId}
</delete>
</mapper> </mapper>