<?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.foreverwin.mesnac.meapi.mapper.DataFieldMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.DataField">
        <result column="HANDLE" property="handle" />
        <result column="DATA_TYPE_BO" property="dataTypeBo" />
        <result column="DATA_FIELD" property="dataField" />
        <result column="FIELD_TYPE" property="fieldType" />
        <result column="VALIDATION_TYPE" property="validationType" />
        <result column="DATA_DEFAULT" property="dataDefault" />
        <result column="SITE" property="site" />
        <result column="BROWSE_ACTIVITY_BO" property="browseActivityBo" />
        <result column="IS_BROWSE" property="isBrowse" />
        <result column="IS_ERP" property="isErp" />
        <result column="MASK_GROUP_BO" property="maskGroupBo" />
        <result column="DESCRIPTION" property="description" />
        <result column="VALIDATION_ACTIVITY_BO" property="validationActivityBo" />
        <result column="CREATED_DATE_TIME" property="createdDateTime" />
        <result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
        <result column="CATEGORY" property="category" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        HANDLE, DATA_TYPE_BO, DATA_FIELD, FIELD_TYPE, VALIDATION_TYPE, DATA_DEFAULT, SITE, BROWSE_ACTIVITY_BO, IS_BROWSE, IS_ERP, MASK_GROUP_BO, DESCRIPTION, VALIDATION_ACTIVITY_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME, CATEGORY
    </sql>

    <!-- BaseMapper标准查询/修改/删除 -->

    <select id="selectByMap" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include>
        FROM DATA_FIELD
        <if test="cm!=null and !cm.isEmpty">
            <where>
                <foreach collection="cm.keys" item="k" separator="AND">
                    <if test="cm[k] != null">
                        ${k} = #{cm[${k}]}
                    </if>
                </foreach>
            </where>
        </if>
    </select>


    <select id="selectOne" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include> FROM DATA_FIELD
        <where>
            <if test="ew.entity.handle!=null">
              HANDLE=#{ew.handle}
            </if>
            <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
            <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
            <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
            <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
            <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
            <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
            <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
            <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
            <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
            <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
            <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
            <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
            <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
            <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
            <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
        </where>
    </select>

    <select id="selectCount" resultType="Integer">
        SELECT COUNT(1) FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                <if test="ew.entity.handle!=null">
                    HANDLE=#{ew.entity.handle}
                </if>
                <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectList" resultMap="BaseResultMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectMaps" resultType="HashMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectObjs" resultType="Object">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectPage" resultMap="BaseResultMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>

    <select id="selectMapsPage" resultType="HashMap">
        SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </select>


    <insert id="insert" parameterType="com.foreverwin.mesnac.meapi.model.DataField">
        INSERT INTO DATA_FIELD
        <trim prefix="(" suffix=")" suffixOverrides=",">
            HANDLE,
            <if test="dataTypeBo!=null">DATA_TYPE_BO,</if>
            <if test="dataField!=null">DATA_FIELD,</if>
            <if test="fieldType!=null">FIELD_TYPE,</if>
            <if test="validationType!=null">VALIDATION_TYPE,</if>
            <if test="dataDefault!=null">DATA_DEFAULT,</if>
            <if test="site!=null">SITE,</if>
            <if test="browseActivityBo!=null">BROWSE_ACTIVITY_BO,</if>
            <if test="isBrowse!=null">IS_BROWSE,</if>
            <if test="isErp!=null">IS_ERP,</if>
            <if test="maskGroupBo!=null">MASK_GROUP_BO,</if>
            <if test="description!=null">DESCRIPTION,</if>
            <if test="validationActivityBo!=null">VALIDATION_ACTIVITY_BO,</if>
            <if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
            <if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
            <if test="category!=null">CATEGORY,</if>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            <if test="dataTypeBo!=null">#{dataTypeBo},</if>
            <if test="dataField!=null">#{dataField},</if>
            <if test="fieldType!=null">#{fieldType},</if>
            <if test="validationType!=null">#{validationType},</if>
            <if test="dataDefault!=null">#{dataDefault},</if>
            <if test="site!=null">#{site},</if>
            <if test="browseActivityBo!=null">#{browseActivityBo},</if>
            <if test="isBrowse!=null">#{isBrowse},</if>
            <if test="isErp!=null">#{isErp},</if>
            <if test="maskGroupBo!=null">#{maskGroupBo},</if>
            <if test="description!=null">#{description},</if>
            <if test="validationActivityBo!=null">#{validationActivityBo},</if>
            <if test="createdDateTime!=null">#{createdDateTime},</if>
            <if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
            <if test="category!=null">#{category},</if>
        </trim>
    </insert>

    <insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.DataField">
        INSERT INTO DATA_FIELD
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <include refid="Base_Column_List"></include>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            #{dataTypeBo},
            #{dataField},
            #{fieldType},
            #{validationType},
            #{dataDefault},
            #{site},
            #{browseActivityBo},
            #{isBrowse},
            #{isErp},
            #{maskGroupBo},
            #{description},
            #{validationActivityBo},
            #{createdDateTime},
            #{modifiedDateTime},
            #{category},
        </trim>
    </insert>






    <update id="update">
        UPDATE DATA_FIELD <trim prefix="SET" suffixOverrides=",">
        <if test="et.handle!=null">HANDLE=#{et.handle},</if>
        <if test="et.dataTypeBo!=null">DATA_TYPE_BO=#{et.dataTypeBo},</if>
        <if test="et.dataField!=null">DATA_FIELD=#{et.dataField},</if>
        <if test="et.fieldType!=null">FIELD_TYPE=#{et.fieldType},</if>
        <if test="et.validationType!=null">VALIDATION_TYPE=#{et.validationType},</if>
        <if test="et.dataDefault!=null">DATA_DEFAULT=#{et.dataDefault},</if>
        <if test="et.site!=null">SITE=#{et.site},</if>
        <if test="et.browseActivityBo!=null">BROWSE_ACTIVITY_BO=#{et.browseActivityBo},</if>
        <if test="et.isBrowse!=null">IS_BROWSE=#{et.isBrowse},</if>
        <if test="et.isErp!=null">IS_ERP=#{et.isErp},</if>
        <if test="et.maskGroupBo!=null">MASK_GROUP_BO=#{et.maskGroupBo},</if>
        <if test="et.description!=null">DESCRIPTION=#{et.description},</if>
        <if test="et.validationActivityBo!=null">VALIDATION_ACTIVITY_BO=#{et.validationActivityBo},</if>
        <if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
        <if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
        <if test="et.category!=null">CATEGORY=#{et.category},</if>
    </trim>
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    HANDLE=#{ew.entity.handle}
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </update>


    <delete id="deleteByMap">
        DELETE FROM DATA_FIELD
        <if test="cm!=null and !cm.isEmpty">
            <where>
                <foreach collection="cm.keys" item="k" separator="AND">
                    <if test="cm[k] != null">
                        ${k} = #{cm[${k}]}
                    </if>
                </foreach>
            </where>
        </if>
    </delete>

    <delete id="delete">
        DELETE FROM DATA_FIELD
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    <if test="ew.entity.handle!=null">
                        HANDLE=#{ew.entity.handle}
                    </if>
                    <if test="ew.entity.dataTypeBo!=null"> AND DATA_TYPE_BO=#{ew.entity.dataTypeBo}</if>
                    <if test="ew.entity.dataField!=null"> AND DATA_FIELD=#{ew.entity.dataField}</if>
                    <if test="ew.entity.fieldType!=null"> AND FIELD_TYPE=#{ew.entity.fieldType}</if>
                    <if test="ew.entity.validationType!=null"> AND VALIDATION_TYPE=#{ew.entity.validationType}</if>
                    <if test="ew.entity.dataDefault!=null"> AND DATA_DEFAULT=#{ew.entity.dataDefault}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.browseActivityBo!=null"> AND BROWSE_ACTIVITY_BO=#{ew.entity.browseActivityBo}</if>
                    <if test="ew.entity.isBrowse!=null"> AND IS_BROWSE=#{ew.entity.isBrowse}</if>
                    <if test="ew.entity.isErp!=null"> AND IS_ERP=#{ew.entity.isErp}</if>
                    <if test="ew.entity.maskGroupBo!=null"> AND MASK_GROUP_BO=#{ew.entity.maskGroupBo}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.validationActivityBo!=null"> AND VALIDATION_ACTIVITY_BO=#{ew.entity.validationActivityBo}</if>
                    <if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
                    <if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
                    <if test="ew.entity.category!=null"> AND CATEGORY=#{ew.entity.category}</if>
                </if>
                <if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
                    ${ew.sqlSegment}
                </if>
            </if>
        </where>
        <if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
            ${ew.sqlSegment}
        </if>
    </delete>

    <!-- BaseMapper标准查询/修改/删除 -->

</mapper>
