<?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.mdmModule.dao.impl.MdmModuleDaoImpl">

    <resultMap id="get-MdmModuleEntity-result" type="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="mdmName" column="mdm_name" jdbcType="VARCHAR"/>
        <result property="mdmLogo" column="mdm_logo" jdbcType="VARCHAR"/>
        <result property="mdmCode" column="mdm_code" jdbcType="INTEGER"/>
        <result property="mdmType" column="mdm_type" jdbcType="VARCHAR"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="createUser" column="createUser" jdbcType="VARCHAR"/>
        <result property="modifyUser" column="modifyUser" jdbcType="VARCHAR"/>
        <result property="sorts" column="sorts" jdbcType="INTEGER"/>
        <result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
        <result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
        <result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
        <result property="sts" column="sts" jdbcType="VARCHAR"/>
        <result property="org_id" column="org_id" jdbcType="VARCHAR"/>
        <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
    </resultMap>



    <!-- 查询的字段-->
    <sql id="MdmModuleEntity_Base_Column_List">
        id
       ,mdm_name
        ,mdm_logo
        ,mdm_code
        ,mdm_type
        ,remark
        ,sorts
        ,create_user_id
        ,create_time
        ,modify_user_id
        ,modify_time
        ,sts
        ,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
        <include refid="MdmModuleEntity_Base_Column_List"/>
        from mdm_module
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id != ''">and id = #{id}</if>
            <if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
            <if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
            <if test="mdmCode != null">and mdm_code = #{mdmCode}</if>
            <if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
            <if test="remark != null and remark != ''">and remark = #{remark}</if>
            <if test="sorts != null">and sorts = #{sorts}</if>
            <if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
            <if test="create_time != null">and create_time = #{create_time}</if>
            <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
            <if test="modify_time != null">and modify_time = #{modify_time}</if>
            <if test="sts != null and sts != ''">and sts = #{sts}</if>
            <if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
            <if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
            and sts='Y'
        </trim>
        <if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!-- 查询符合条件的数量 -->
    <select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        select count(1) from mdm_module
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id != ''">and id = #{id}</if>
            <if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
            <if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
            <if test="mdmCode != null">and mdm_code = #{mdmCode}</if>
            <if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
            <if test="remark != null and remark != ''">and remark = #{remark}</if>
            <if test="sorts != null">and sorts = #{sorts}</if>
            <if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
            <if test="create_time != null">and create_time = #{create_time}</if>
            <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
            <if test="modify_time != null">and modify_time = #{modify_time}</if>
            <if test="sts != null and sts != ''">and sts = #{sts}</if>
            <if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
            <if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
            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-MdmModuleEntity-result"
            parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        select
        <include refid="MdmModuleEntity_Base_Column_List"/>
        from mdm_module
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
            <if test="mdmName != null and mdmName != ''">and mdm_name like concat('%',#{mdmName},'%')</if>
            <if test="mdmLogo != null and mdmLogo != ''">and mdm_logo like concat('%',#{mdmLogo},'%')</if>
            <if test="mdmCode != null">and mdm_code like concat('%',#{mdmCode},'%')</if>
            <if test="mdmType != null and mdmType != ''">and mdm_type like concat('%',#{mdmType},'%')</if>
            <if test="remark != null and remark != ''">and remark like concat('%',#{remark},'%')</if>
            <if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
            <if test="create_user_id != null and create_user_id != ''">and create_user_id like
                concat('%',#{create_user_id},'%')
            </if>
            <if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
            <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
                concat('%',#{modify_user_id},'%')
            </if>
            <if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
            <if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
            <if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
            <if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
            and sts='Y'
        </trim>
        <if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!-- 查询列表 字段采用or格式 -->
    <select id="MdmModuleentity_list_or" resultMap="get-MdmModuleEntity-result"
            parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        select
        <include refid="MdmModuleEntity_Base_Column_List"/>
        from mdm_module
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id != ''">or id = #{id}</if>
            <if test="mdmName != null and mdmName != ''">or mdm_name = #{mdmName}</if>
            <if test="mdmLogo != null and mdmLogo != ''">or mdm_logo = #{mdmLogo}</if>
            <if test="mdmCode != null">or mdm_code = #{mdmCode}</if>
            <if test="mdmType != null and mdmType != ''">or mdm_type = #{mdmType}</if>
            <if test="remark != null and remark != ''">or remark = #{remark}</if>
            <if test="sorts != null">or sorts = #{sorts}</if>
            <if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
            <if test="create_time != null">or create_time = #{create_time}</if>
            <if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
            <if test="modify_time != null">or modify_time = #{modify_time}</if>
            <if test="sts != null and sts != ''">or sts = #{sts}</if>
            <if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
            <if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
            and sts='Y'
        </trim>
        <if test=" sort == null or sort == ''.toString()  ">order by sorts asc</if>
        <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
    </select>

    <!--新增所有列-->
    <insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        insert into mdm_module(
        <trim suffix="" suffixOverrides=",">
            <if test="id != null and id != ''">id ,</if>
            <if test="mdmName != null and mdmName != ''">mdm_name ,</if>
            <if test="mdmLogo != null and mdmLogo != ''">mdm_logo ,</if>
            <if test="mdmCode != null">mdm_code ,</if>
            <if test="mdmCode == null">mdm_code ,</if>
            <if test="mdmType != null and mdmType != ''">mdm_type ,</if>
            <if test="remark != null and remark != ''">remark ,</if>
            <if test="sorts != null">sorts ,</if>
            <if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
            <if test="create_time != null">create_time ,</if>
            <if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
            <if test="modify_time != null">modify_time ,</if>
            <if test="sts != null and sts != ''">sts ,</if>
            <if test="org_id != null and org_id != ''">org_id ,</if>
            <if test="companyId != null and companyId != ''">company_id ,</if>
            <if test="sts == null ">sts,</if>
        </trim>
        )values(
        <trim suffix="" suffixOverrides=",">
            <if test="id != null and id != ''">#{id} ,</if>
            <if test="mdmName != null and mdmName != ''">#{mdmName} ,</if>
            <if test="mdmLogo != null and mdmLogo != ''">#{mdmLogo} ,</if>
            <if test="mdmCode != null">#{mdmCode} ,</if>
            <if test="mdmCode == null ">(SELECT IFNULL(MAX(b.mdm_code)+1,10001) AS mdmCode FROM mdm_module b ),</if>
            <if test="mdmType != null and mdmType != ''">#{mdmType} ,</if>
            <if test="remark != null and remark != ''">#{remark} ,</if>
            <if test="sorts != null">#{sorts} ,</if>
            <if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
            <if test="create_time != null">#{create_time} ,</if>
            <if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
            <if test="modify_time != null">#{modify_time} ,</if>
            <if test="sts != null and sts != ''">#{sts} ,</if>
            <if test="org_id != null and org_id != ''">#{org_id} ,</if>
            <if test="companyId != null and companyId != ''">#{companyId} ,</if>
            <if test="sts == null ">'Y',</if>
        </trim>
        )
    </insert>
    <!-- 批量新增 -->
    <insert id="entityInsertBatch">
        insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time,
        modify_user_id, modify_time, sts, org_id, company_id, sts)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
            'Y')
        </foreach>
    </insert>
    <!-- 批量新增或者修改-->
    <insert id="entityInsertOrUpdateBatch">
        insert into mdm_module(mdm_name, mdm_logo, mdm_code, mdm_type, remark, create_user_id, create_time,
        modify_user_id, modify_time, sts, org_id, company_id)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.mdmName},#{entity.mdmLogo},#{entity.mdmCode},#{entity.mdmType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
        </foreach>
        on duplicate key update
        mdm_name = values(mdm_name),
        mdm_logo = values(mdm_logo),
        mdm_code = values(mdm_code),
        mdm_type = values(mdm_type),
        remark = values(remark),
        create_user_id = values(create_user_id),
        create_time = values(create_time),
        modify_user_id = values(modify_user_id),
        modify_time = values(modify_time),
        sts = values(sts),
        org_id = values(org_id),
        company_id = values(company_id)
    </insert>
    <!--通过主键修改方法-->
    <update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        update mdm_module set
        <trim suffix="" suffixOverrides=",">
            <if test="mdmName != null and mdmName != ''">mdm_name = #{mdmName},</if>
            <if test="mdmLogo != null and mdmLogo != ''">mdm_logo = #{mdmLogo},</if>
            <if test="mdmCode != null">mdm_code = #{mdmCode},</if>
            <if test="mdmType != null and mdmType != ''">mdm_type = #{mdmType},</if>
            <if test="remark != null and remark != ''">remark = #{remark},</if>
            <if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
            <if test="create_time != null">create_time = #{create_time},</if>
            <if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
            <if test="modify_time != null">modify_time = #{modify_time},</if>
            <if test="sts != null and sts != ''">sts = #{sts},</if>
            <if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
            <if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 逻辑删除 -->
    <update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
update mdm_module  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
    <!-- 多条件逻辑删除 -->
    <update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id != ''">and id = #{id}</if>
            <if test="mdmName != null and mdmName != ''">and mdm_name = #{mdmName}</if>
            <if test="mdmLogo != null and mdmLogo != ''">and mdm_logo = #{mdmLogo}</if>
            <if test="mdmCode != null">and mdm_code = #{mdmCode}</if>
            <if test="mdmType != null and mdmType != ''">and mdm_type = #{mdmType}</if>
            <if test="remark != null and remark != ''">and remark = #{remark}</if>
            <if test="sorts != null">and sorts = #{sorts}</if>
            <if test="sts != null and sts != ''">and sts = #{sts}</if>
            <if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
            and sts='Y'
        </trim>
    </update>
    <!--通过主键删除-->
    <delete id="entity_delete">
    delete from mdm_module where id = #{id}
</delete>

    <delete id="deleteTable" >
        DROP TABLE ${tableName}
    </delete>
    <!-- 分页查询列表 采用like格式 -->
    <select id="queryMdm" resultMap="get-MdmModuleEntity-result"
            parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
        select
        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>


    <select id="createTable" resultType="java.lang.Integer">
        CREATE TABLE ${tableName} (
        <choose>
            <when test="tableType  == '1'.toString()">
                `id` varchar(50) NOT NULL COMMENT '唯一标识码',
                `document_rule` varchar(50) DEFAULT NULL COMMENT '单据规则',
                `document_rule_num` bigint DEFAULT NULL COMMENT '单据规则流水号',
                `data_status` varchar(1) DEFAULT NULL COMMENT '数据状态 Y正常 N删除 F修改',
                `add_status` varchar(1) DEFAULT NULL COMMENT '新增数据状态 0待下发 1已下发',
                `update_status` varchar(1) DEFAULT NULL COMMENT '修改数据状态 0待下发 1已下发',
                `delete_status` varchar(1) DEFAULT NULL COMMENT '删除数据状态 0待下发 1已下发',
                `sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
                `create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
                `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                `modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
                `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
                `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
                `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
                `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
                `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id',
                `mdm_up_id` varchar(100) DEFAULT NULL COMMENT 'mdm_up_id',
            </when>
            <when test="tableType  == '2'.toString()">
                `id` varchar(50) NOT NULL COMMENT '唯一标识码',
                `formmain_id` varchar(50) DEFAULT NULL COMMENT 'formmain_id',
                `data_status` varchar(1) DEFAULT NULL COMMENT '数据状态 Y正常 N删除 F修改',
                `sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
                `create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
                `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                `modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
                `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
                `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
                `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
                `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
                `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id',
            </when>
            <when test="tableType  == '3'.toString()">
                `id` varchar(50) NOT NULL COMMENT '唯一标识码',
                `formmain_id` varchar(50) DEFAULT NULL COMMENT 'formmain_id',
                `source_name` varchar(255) DEFAULT NULL COMMENT '来源名称',
                `code` varchar(255) DEFAULT NULL COMMENT '编码',
                `source_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '源数据',
                `option_type` varchar(255) DEFAULT NULL COMMENT '操作类型',
                `option_name` varchar(255) DEFAULT NULL COMMENT '操作人',
                `sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
                `create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
                `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                `modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
                `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
                `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
                `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
                `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
                `data_type` varchar(255) DEFAULT NULL COMMENT '状态 1、成功2、失败',
                `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注',
            </when>
            <when test="tableType  == '4'.toString()">
                `id` varchar(50) NOT NULL COMMENT '唯一标识码',
                `formmain_id` varchar(50) DEFAULT NULL COMMENT 'formmain_id',
                `target_app` varchar(255) DEFAULT NULL COMMENT '目标应用',
                `target_api` varchar(255) DEFAULT NULL COMMENT '目标api',
                `source_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '源数据',
                `option_type` varchar(255) DEFAULT NULL COMMENT '操作类型',
                `sorts` bigint NOT NULL AUTO_INCREMENT COMMENT '排序',
                `create_user_id` varchar(50) DEFAULT NULL COMMENT '创建人id',
                `create_time` datetime DEFAULT NULL COMMENT '创建时间',
                `modify_user_id` varchar(50) DEFAULT NULL COMMENT '修改人id',
                `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
                `sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
                `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
                `company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
                `data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败',
                `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注',
                `distribute_id` varchar(50) DEFAULT NULL COMMENT 'distribute_id',
                `api_id` varchar(50) DEFAULT NULL COMMENT 'apiid',
                `app_id` varchar(50) DEFAULT NULL COMMENT 'app_id',
            </when>
        </choose>
        PRIMARY KEY (`sorts`,`id`) USING BTREE
        ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4
        <if test="tableRemark != null and tableRemark != ''"> COMMENT = #{tableRemark} </if>
    </select>






    <!--通过ID获取数据 -->
    <select id="alterTable" resultType="java.lang.Integer">
        ALTER TABLE ${tableName}
        <trim suffix="" suffixOverrides=",">
            <foreach collection="databaseFields" item="item" index="index">
                <choose>
                    <when test="item.filedType  == '3'.toString()">
                        <choose>
                            <when test="item.dataType  == '1'.toString()">
                                MODIFY COLUMN ${item.enName} varchar(${item.filedLength}) DEFAULT NULL
                                COMMENT #{item.chName},
                            </when>
                            <otherwise>
                                add COLUMN ${item.enName} varchar(${item.filedLength}) DEFAULT NULL COMMENT
                                #{item.chName},
                            </otherwise>
                        </choose>
                    </when>
                    <when test="item.filedType  == '1'.toString()">
                        <choose>
                            <when test="item.dataType  == '1'.toString()">
                                MODIFY COLUMN ${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT
                                #{item.chName},
                            </when>
                            <otherwise>
                                add COLUMN ${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT
                                #{item.chName},
                            </otherwise>
                        </choose>
                    </when>
                    <when test="item.filedType  == '2'.toString()">
                        <choose>
                            <when test="item.dataType  == '1'.toString()">
                                MODIFY COLUMN ${item.enName} decimal(${item.filedLength},8) DEFAULT NULL COMMENT
                                #{item.chName},
                            </when>
                            <otherwise>
                                add COLUMN ${item.enName} decimal(${item.filedLength},8) DEFAULT NULL COMMENT
                                #{item.chName},
                            </otherwise>
                        </choose>
                    </when>
                    <when test="item.filedType  == '4'.toString()">
                        <choose>
                            <when test="item.dataType  == '1'.toString()">
                                MODIFY COLUMN ${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
                            </when>
                            <otherwise>
                                add COLUMN ${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
                            </otherwise>
                        </choose>
                    </when>
                </choose>
            </foreach>
        </trim>
    </select>


    <select id="alterTableField"  databaseId="mysql" resultType="java.lang.Integer">

        ALTER TABLE ${dbName}
                <choose>
                    <when test="filedType  == '1'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add COLUMN ${enName} bigint(${filedLength}) DEFAULT NULL COMMENT
                                #{chName}
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop COLUMN ${enName}
                            </when>
                            <otherwise>
                                MODIFY COLUMN ${enName} bigint(${filedLength}) DEFAULT NULL COMMENT
                                #{chName}
                            </otherwise>
                        </choose>
                    </when>
                    <when test="filedType  == '3'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add COLUMN ${enName} varchar(${filedLength}) DEFAULT NULL
                                COMMENT #{chName}
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop COLUMN ${enName}
                            </when>
                            <otherwise>
                                MODIFY COLUMN ${enName} varchar(${filedLength}) DEFAULT NULL COMMENT
                                #{chName}
                            </otherwise>
                        </choose>
                    </when>

                    <when test="filedType  == '2'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add COLUMN ${enName} decimal(${filedLength},8) DEFAULT NULL COMMENT
                                #{chName}
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop COLUMN ${enName}
                            </when>
                            <otherwise>
                                MODIFY COLUMN ${enName} decimal(${filedLength},8) DEFAULT NULL COMMENT
                                #{chName}
                            </otherwise>
                        </choose>
                    </when>
                    <when test="filedType  == '4'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add COLUMN ${enName} datetime DEFAULT NULL COMMENT #{chName}
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop COLUMN ${enName}
                            </when>
                            <otherwise>
                                MODIFY COLUMN ${enName} datetime DEFAULT NULL COMMENT #{chName}
                            </otherwise>
                        </choose>
                    </when>
                </choose>
    </select>
    <select id="alterTableField" databaseId="oracle" resultType="java.lang.Integer">

        ALTER TABLE "businesscenter".${dbName}
                <choose>
                    <when test="filedType  == '1'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add ${enName} bigint(${filedLength}) DEFAULT NULL
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop  ${enName}
                            </when>
                            <otherwise>
                                MODIFY  ${enName} bigint(${filedLength}) DEFAULT NULL
                            </otherwise>
                        </choose>
                    </when>
                    <when test="filedType  == '3'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add  ${enName} varchar(${filedLength}) DEFAULT NULL
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop  ${enName}
                            </when>
                            <otherwise>
                                MODIFY  ${enName} varchar(${filedLength}) DEFAULT NULL
                            </otherwise>
                        </choose>
                    </when>

                    <when test="filedType  == '2'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add  ${enName} decimal(${filedLength},8) DEFAULT NULL
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop  ${enName}
                            </when>
                            <otherwise>
                                MODIFY  ${enName} decimal(${filedLength},8) DEFAULT NULL
                            </otherwise>
                        </choose>
                    </when>
                    <when test="filedType  == '4'.toString()">
                        <choose>
                            <when test="dataType  == '1'.toString()">
                                add  ${enName} datetime DEFAULT NULL
                            </when>
                            <when test="dataType  == '3'.toString()">
                                drop  ${enName}
                            </when>
                            <otherwise>
                                MODIFY  ${enName} datetime DEFAULT NULL
                            </otherwise>
                        </choose>
                    </when>
                </choose>
    </select>





    <!--通过ID获取数据 -->
    <select id="alterTableName" resultType="java.lang.Integer">
			ALTER TABLE ${tableName} COMMENT = #{tableRemark}
	</select>

    <!-- 分页查询列表 采用like格式 -->
    <select id="queryMdmShowData" resultType="java.util.HashMap"
            parameterType="com.hzya.frame.mdm.entity.MdmQuery">
        select
        <if test="returnField != null and returnField.size>0">
            <trim suffixOverrides=",">
                <foreach collection="returnField" item="returnField">
                    a.${returnField} as ${returnField} ,
                </foreach>
            </trim>
        </if>
        <if test="returnField == null or returnField.size == 0">
            a.*
        </if>
        from ${tableName} a
        <trim prefix="where" prefixOverrides="and">
            <if test="queryCondition != null and queryCondition.size>0">
                <foreach collection="queryCondition" item="item" index="index">
                    ${item.getValueByType('a.')}
                </foreach>
            </if>
            and a.sts='Y' and a.data_status != 'N'
            <if test="detailQueryCondition != null and detailQueryCondition.size>0">
                <foreach collection="detailQueryCondition" item="item" index="index">
                    AND a.id IN (
                    SELECT
                    formmain_id
                    FROM
                    ${item.tableName}
                    <trim prefix="where" prefixOverrides="and">
                        sts = 'Y'
                        <if test="item.queryCondition != null and item.queryCondition.size>0">
                            <foreach collection="item.queryCondition" item="itema" index="index">
                                ${itema.getValueByType('')}
                            </foreach>
                        </if>
                    </trim>
                    )
                </foreach>
            </if>
        </trim>
        order by a.sorts asc
    </select>
    <!-- 分页查询列表 采用like格式 -->
    <select id="queryTemplateDataMore" resultType="java.util.HashMap"
            parameterType="com.hzya.frame.mdm.entity.MdmDto">
        select
        ${value} as id,
        ${label} as label,
        ${upId} as upID
        from ${tableName}
        <trim prefix="where" prefixOverrides="and">
            <if test="ids != null and ids.length >0">
                and id in (
                <trim suffix="" suffixOverrides=",">
                    <foreach collection="ids" item="item" index="index">
                        #{item},
                    </foreach>
                </trim>
                )
            </if>
            and sts = 'Y'  and data_status != 'N'
        </trim>
        order by sorts asc
    </select>
    <!-- 分页查询列表 采用like格式 -->
    <select id="queryTemplateDataOne" resultType="java.util.HashMap"
            parameterType="com.hzya.frame.mdm.entity.MdmDto">
        select
        ${value} as id,
        ${label} as label,
        ${upId} as upID
        from ${tableName}
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id !='' ">and id = #{id}</if>
            and sts = 'Y'  and data_status != 'N'
        </trim>
        order by sorts asc
    </select>
    <!-- 分页查询列表 采用like格式 -->
    <select id="queryDataAll" resultType="java.util.HashMap"
            parameterType="com.hzya.frame.mdm.entity.MdmDto">
		select
		id as qsdfg,
		${label},
		${upId}
		from ${tableName}
		where sts = 'Y'  and data_status != 'N'
		order by sorts asc
	</select>
    <!-- 查询符合条件的数量 -->
    <select id="checkData" resultType="Integer">
        SELECT
        count(*)
        from
        ${tableName}
        <trim prefix="where" prefixOverrides="and">
            <if test="filedName != null and filedName !='' and filedValue != null and filedValue !='' ">
                and ${filedName} = #{filedValue}
            </if>

            <if test="id != null and id !='' ">and id != #{id}</if>
            and sts = 'Y'
        </trim>
    </select>
    <update id="updateForm" parameterType="com.hzya.frame.mdm.entity.MdmDataDto">
        update ${tableName} set
        <trim suffix="" suffixOverrides=",">
            <if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
                <foreach collection="mdmDataFiledDtos" item="item" index="index">
                    <if test="item.filedsName != 'logid'.toString() ">
                        ${item.filedsName} = #{item.filedsValue},
                    </if>
                    <if test="item.filedsName == 'logid'.toString() ">
                        modify_user_id = #{item.filedsValue},
                    </if>
                </foreach>
            </if>
        </trim>
        where id = #{id}
    </update>
    <insert id="saveForm" databaseId="oracle" parameterType="com.hzya.frame.mdm.entity.MdmDataDto">
        insert into ${tableName}(
        <trim suffix="" suffixOverrides=",">
            <if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
                <foreach collection="mdmDataFiledDtos" item="item" index="index">
                    <if test="item.filedsName != 'logid'.toString() ">
                        ${item.filedsName},
                    </if>
                    <if test="item.filedsName == 'logid'.toString() ">
                        create_user_id,
                        modify_user_id,
                    </if>
                </foreach>
            </if>
            create_time,
            modify_time,
            sts,
            <if test="dbType  == '1'.toString()">
                document_rule,
                document_rule_num,
            </if>
        </trim>
        )values
        (
        <trim suffix="" suffixOverrides=",">
            <if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
                <foreach collection="mdmDataFiledDtos" item="item" index="index">
                    <if test="item.filedsName != 'logid'.toString() ">
                        #{item.filedsValue},
                    </if>
                    <if test="item.filedsName == 'logid'.toString() ">
                        #{item.filedsValue},
                        #{item.filedsValue},
                    </if>
                </foreach>
            </if>

            now(),
            now(),
            'Y',
            <if test="dbType  == '1'.toString()">


                concat(#{documentRule},
                LPAD( CAST( ( SELECT IFNULL( MAX(f.document_rule_num), 0 )+ 1 FROM ${tableName} f WHERE DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ) ) AS varchar(50) ), ${documentRuleNum} , '0' )
                ),
                (SELECT IFNULL( MAX(f.document_rule_num), 0 )+ 1 FROM ${tableName} f WHERE DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )
                )
            </if>
        </trim>
        )
    </insert>
    <insert id="saveForm" parameterType="com.hzya.frame.mdm.entity.MdmDataDto">
        insert into ${tableName}(
        <trim suffix="" suffixOverrides=",">
            <if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
                <foreach collection="mdmDataFiledDtos" item="item" index="index">
                    <if test="item.filedsName != 'logid'.toString() ">
                        ${item.filedsName},
                    </if>
                    <if test="item.filedsName == 'logid'.toString() ">
                        create_user_id,
                        modify_user_id,
                    </if>
                </foreach>
            </if>
            create_time,
            modify_time,
            sts,
            <if test="dbType  == '1'.toString()">
                document_rule,
                document_rule_num,
            </if>
        </trim>
        )values
        (
        <trim suffix="" suffixOverrides=",">
            <if test="mdmDataFiledDtos != null and mdmDataFiledDtos.size>0">
                <foreach collection="mdmDataFiledDtos" item="item" index="index">
                    <if test="item.filedsName != 'logid'.toString() ">
                        #{item.filedsValue},
                    </if>
                    <if test="item.filedsName == 'logid'.toString() ">
                        #{item.filedsValue},
                        #{item.filedsValue},
                    </if>
                </foreach>
            </if>

            now(),
            now(),
            'Y',
            <if test="dbType  == '1'.toString()">
                ( concat(#{documentRule},
                (SELECT
                IF
                (
                LENGTH( (SELECT
                IFNULL(MAX(b.document_rule_num),0)+1
                FROM
                ${tableName} b
                WHERE
                DATE_FORMAT( b.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) &lt;= ${documentRuleNum},
                LPAD( (SELECT
                IFNULL(MAX(c.document_rule_num),0)+1
                FROM
                ${tableName} c
                WHERE
                DATE_FORMAT( c.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ),
                (SELECT
                IFNULL(MAX(d.document_rule_num),0)+1
                FROM
                ${tableName} d
                WHERE
                DATE_FORMAT( d.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ))
                )
                )
                )),
                (SELECT
                IF
                (
                LENGTH( (SELECT
                IFNULL(MAX(e.document_rule_num),0)+1
                FROM
                ${tableName} e
                WHERE
                DATE_FORMAT( e.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )) ) &lt;= ${documentRuleNum},
                LPAD( (SELECT
                IFNULL(MAX(f.document_rule_num),0)+1
                FROM
                ${tableName} f
                WHERE
                DATE_FORMAT( f.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' )), ${documentRuleNum}, '0' ),
                (SELECT
                IFNULL(MAX(g.document_rule_num),0)+1
                FROM
                ${tableName} g
                WHERE
                DATE_FORMAT( g.create_time, '%Y-%m' ) = DATE_FORMAT( now(), '%Y-%m' ))
                )
                )
            </if>
        </trim>
        )
    </insert>
    <update id="deleteTemplateById" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
        update ${tableName} set
        data_status ='N',modify_time = now(),modify_user_id = #{loginId}
        <if test="formmain_id == null  ">,delete_status = '0' </if>
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id !='' ">and id = #{id}</if>
            <if test="formmain_id != null and formmain_id !='' ">and formmain_id = #{formmain_id}</if>
            and sts='Y'
        </trim>
    </update>

    <update id="deleteChilder" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
        update ${tableName} set
        data_status='N',modify_time = now(),modify_user_id = #{loginId},delete_status = '0'
        <trim prefix="where" prefixOverrides="and">
            <if test="upIdFiled != null and upIdFiled !=''  and upIdFiledValue != null and upIdFiledValue !=''">
                and ${upIdFiled} like concat(#{upIdFiledValue},'%')
            </if>
            and sts='Y'
        </trim>
    </update>

    <!-- 分页查询列表 采用like格式 -->
    <select id="querySelectData" resultType="java.util.HashMap" parameterType="com.hzya.frame.mdm.entity.MdmDto">
        select
        ${value},
        ${label}
        from ${tableName}
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id !='' ">and ${value} = #{id}</if>
            <if test="lableValue != null and lableValue !='' ">and ${label} like concat('%',#{lableValue},'%')</if>
            and sts = 'Y'
            and ${label} is not null
        </trim>
        order by sorts asc
    </select>

    <!--通过mdmCode删除-->
    <delete id="deleteMdmModuleEntity" parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
    delete from mdm_module where mdm_code = #{mdmCode}
</delete>


    <!-- 查询符合条件的数量 -->
    <select id="queryMainCount" resultType="Integer" parameterType="com.hzya.frame.mdm.entity.MdmQuery">
        select count(1) from ${tableName} where sts='Y'
    </select>

    <!-- 根据表名称查询所有的字段，返回小写个是-->
    <select id="queryMdMFields" databaseId="oracle" resultType="String"   parameterType="java.util.HashMap" >
        SELECT
                LOWER(COLUMN_NAME)  as fileds
        FROM
            USER_TAB_COLUMNS
        WHERE
          TABLE_NAME =  #{tableName}

    </select>

    <!-- 根据表名称查询所有的字段，返回小写个是-->
    <select id="queryMdMFields" databaseId="mysql" resultType="String"   parameterType="java.util.HashMap" >
        SELECT LOWER(COLUMN_NAME)
        FROM information_schema.columns
        WHERE table_name = #{tableName}
    </select>
    <!-- 分页查询列表 采用like格式 -->
    <select id="queryMdmST" resultType="com.alibaba.fastjson.JSONObject"  parameterType="java.util.HashMap">
        select

        <if test="field != null and field.size>0">
            <foreach item="field" collection="fields"   separator=","  >
                ${field}
            </foreach>
        </if>
        <if test="field == null or field.size == 0">
            *
        </if>
         from ${tableName}
        <trim prefix="where" prefixOverrides="and">
            <if test="documentRule != null and documentRule !='' ">and document_rule = #{documentRule}</if>
            <if test="dataStatus != null and dataStatus !='' ">and data_status = #{dataStatus}</if>
            <if test="addStatus != null and addStatus !='' ">and add_status = #{addStatus}</if>
            <if test="updateStatus != null and updateStatus !='' ">and update_status = #{updateStatus}</if>
            <if test="deleteStatus != null and deleteStatus !='' ">and delete_status = #{deleteStatus}</if>
            <if test="id != null and id !='' ">and id = #{id}</if>
            <if test="mdmModuleDistributeDetailEntities != null and mdmModuleDistributeDetailEntities.size>0">
                AND
                <foreach collection="mdmModuleDistributeDetailEntities" item="item" index="index" open="(" close=")" >
                    ${item.leftBracket} ${item.filedId}
                    <choose>
                        <when test="item.compareType == '1'.toString() ">
                            = #{item.filedVaule}
                        </when>
                        <when test="item.compareType == '2'.toString() ">
                           != #{item.filedVaule}
                        </when>
                        <when test="item.compareType == '3'.toString() ">
                            &gt; #{item.filedVaule}
                        </when>
                        <when test="item.compareType == '4'.toString() ">
                            &lt; #{item.filedVaule}
                        </when>
                        <when test="item.compareType == '5'.toString() ">
                            like #{item.filedVaule}
                        </when>
                        <when test="item.compareType == '6'.toString() ">
                            not like #{item.filedVaule}
                        </when>
                    </choose>

                    <choose>
                        <when test="item.connectionSymbol == '1'.toString() ">
                            <choose>
                                <when test="item.rightParenthesis == ')'.toString() ">
                                    ${item.rightParenthesis}
                                </when>
                                <otherwise>
                                    ${item.rightParenthesis} and
                                </otherwise>
                            </choose>
                        </when>
                        <when test="item.connectionSymbol == '2'.toString() ">
                            <choose>
                                <when test="item.rightParenthesis == ')'.toString() ">
                                    ${item.rightParenthesis}
                                </when>
                                <otherwise>
                                    ${item.rightParenthesis} or
                                </otherwise>
                            </choose>
                        </when>
                        <otherwise>
                            ${item.rightParenthesis}
                        </otherwise>
                    </choose>
                </foreach>
            </if>
            <if test="ids != null and ids.size>0">
                AND id in
                <foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
                    #{item.id}
                </foreach>
            </if>
            and sts = 'Y'
            order by sorts asc
            <if test="size != null and size !='' ">limit #{size}</if>
        </trim>
    </select>

    <!-- 分页查询列表 采用like格式 -->
    <select id="queryMdmSTDetail" resultType="com.alibaba.fastjson.JSONObject"
            parameterType="java.util.HashMap">
        select
        <if test="field != null and field.size>0">
            <foreach item="field" collection="fields"   separator=","  >
                ${field}
            </foreach>
        </if>
        <if test="field == null or field.size == 0">
            *
        </if>

         from ${tableName} where  sts='Y' and formmain_id = #{formmainId}
    </select>

    <update id="updateMdmSTs" parameterType="java.util.HashMap">
        update ${tableName} set
        <trim prefixOverrides=",">
            <if test="addStatus != null and addStatus !='' ">, add_status = #{addStatus}</if>
            <if test="updateStatus != null and updateStatus !='' ">, update_status = #{updateStatus}</if>
            <if test="deleteStatus != null and deleteStatus !='' ">, delete_status = #{deleteStatus}</if>
            ,modify_time = now()
        </trim>
        <trim prefix="where" prefixOverrides="and">
            <if test="id != null and id !='' ">and id = #{id}</if>
            <if test="dataStatus != null and dataStatus !='' ">and data_status = #{dataStatus}</if>
        </trim>
    </update>


    <update id="updataTreeUpData" parameterType="java.util.HashMap">
        UPDATE ${tableName}
        SET ${upFiled} = CONCAT(#{newData},SUBSTRING_INDEX( ${upFiled}, #{oldData},- 1 )),
        modify_time = now(),
        modify_user_id = #{modify_user_id},
        data_status = 'F',
        update_status = '0'
        WHERE
        ${upFiled} LIKE  concat(#{oldData},'%')
        AND sts = 'Y'
        AND data_status != 'N'
    </update>


    <update id="updataTreeUpDataDetail" parameterType="java.util.HashMap">
        UPDATE ${tableName} a
            JOIN ${mainDBTable} b ON a.formmain_id = b.id and b.sts = 'Y'
        SET
            a.${upFiled}=CONCAT(#{newData},SUBSTRING_INDEX(${upFiled},#{oldData},-1)),
            a.modify_time = now(),
            a.modify_user_id = '1',
            a.data_status = 'F',

            b.update_status = '0' ,
            b.data_status = 'F',
            b.modify_time = now(),
            b.modify_user_id = '1'

        WHERE
                a.${upFiled} LIKE concat( #{oldData}, '%' )
          AND a.sts = 'Y'
          AND a.data_status != 'N'
          AND b.sts = 'Y'
          AND b.data_status != 'N'
    </update>


    <!-- 分页查询列表 采用like格式 -->
    <select id="queryDataId" resultType="com.hzya.frame.mdm.entity.MdmFiledsRuleDto"
            parameterType="com.hzya.frame.mdm.entity.MdmFiledsRuleDto">
        select
        data_id as dataId
        from ${typeFiled} where  sts='Y' and id = #{id}
    </select>
</mapper>

