<?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.DcParameterMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.DcParameter">
        <result column="HANDLE" property="handle" />
        <result column="DC_GROUP_BO" property="dcGroupBo" />
        <result column="PARAMETER_NAME" property="parameterName" />
        <result column="DATA_TYPE" property="dataType" />
        <result column="STATUS" property="status" />
        <result column="ALLOW_MISSING_VALUE" property="allowMissingValue" />
        <result column="MIN_VALUE" property="minValue" />
        <result column="MAX_VALUE" property="maxValue" />
        <result column="SEQUENCE" property="sequence" />
        <result column="PERFORM_SPC" property="performSpc" />
        <result column="DISPLAY_CHART" property="displayChart" />
        <result column="DESCRIPTION" property="description" />
        <result column="UNITS" property="units" />
        <result column="SPC_CHART_BO" property="spcChartBo" />
        <result column="DISPLAY_DATA_INFORMATION" property="displayDataInformation" />
        <result column="OVERRIDE_MIN_MAX" property="overrideMinMax" />
        <result column="DC_VALUE_MASK" property="dcValueMask" />
        <result column="EXPRESSION_BUILDER" property="expressionBuilder" />
        <result column="REQUIRED_DATA_ENTRIES" property="requiredDataEntries" />
        <result column="OPTIONAL_DATA_ENTRIES" property="optionalDataEntries" />
        <result column="SHORT_RUN" property="shortRun" />
        <result column="OPC_ACQUIRE_AT" property="opcAcquireAt" />
        <result column="OPC_SERVER" property="opcServer" />
        <result column="OPC_DEVICE" property="opcDevice" />
        <result column="OPC_TAG" property="opcTag" />
        <result column="OPC_SERVER_HOSTNAME" property="opcServerHostname" />
        <result column="OPC_SERVER_MODEL" property="opcServerModel" />
        <result column="OPC_SERVER_PROGID" property="opcServerProgid" />
        <result column="OPC_SERVER_CLSID" property="opcServerClsid" />
        <result column="OPC_DEVICE_ID" property="opcDeviceId" />
        <result column="OPC_TAG_ID" property="opcTagId" />
        <result column="SCRIPT_BO" property="scriptBo" />
        <result column="BOOLEAN_ZERO_VALUE" property="booleanZeroValue" />
        <result column="BOOLEAN_ONE_VALUE" property="booleanOneValue" />
        <result column="ERP_QM_CHAR_TYPE" property="erpQmCharType" />
        <result column="ERP_IS_QM_CRITICAL" property="erpIsQmCritical" />
        <result column="SOFT_LIMIT_CHECK" property="softLimitCheck" />
        <result column="AUTO_LOG_NC" property="autoLogNc" />
        <result column="NC_CODE_BO" property="ncCodeBo" />
        <result column="DATA_FIELD_BO" property="dataFieldBo" />
        <result column="INSPECTION_SAMPLE_SIZE" property="inspectionSampleSize" />
        <result column="TARGET_VALUE" property="targetValue" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        HANDLE, DC_GROUP_BO, PARAMETER_NAME, DATA_TYPE, STATUS, ALLOW_MISSING_VALUE, MIN_VALUE, MAX_VALUE, SEQUENCE, PERFORM_SPC, DISPLAY_CHART, DESCRIPTION, UNITS, SPC_CHART_BO, DISPLAY_DATA_INFORMATION, OVERRIDE_MIN_MAX, DC_VALUE_MASK, EXPRESSION_BUILDER, REQUIRED_DATA_ENTRIES, OPTIONAL_DATA_ENTRIES, SHORT_RUN, OPC_ACQUIRE_AT, OPC_SERVER, OPC_DEVICE, OPC_TAG, OPC_SERVER_HOSTNAME, OPC_SERVER_MODEL, OPC_SERVER_PROGID, OPC_SERVER_CLSID, OPC_DEVICE_ID, OPC_TAG_ID, SCRIPT_BO, BOOLEAN_ZERO_VALUE, BOOLEAN_ONE_VALUE, ERP_QM_CHAR_TYPE, ERP_IS_QM_CRITICAL, SOFT_LIMIT_CHECK, AUTO_LOG_NC, NC_CODE_BO, DATA_FIELD_BO, INSPECTION_SAMPLE_SIZE, TARGET_VALUE
    </sql>

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

    <select id="selectByMap" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include>
        FROM DC_PARAMETER
        <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 DC_PARAMETER
        <where>
            <if test="ew.entity.handle!=null">
              HANDLE=#{ew.handle}
            </if>
            <if test="ew.entity.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
            <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
            <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
            <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
            <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
            <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
            <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
            <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
            <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
            <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
            <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
            <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
            <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
            <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
            <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
            <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
            <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
            <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
            <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
            <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
            <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
            <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
            <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
            <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
            <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
            <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
            <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
            <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
            <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
            <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
            <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
            <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
            <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
            <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
            <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
            <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
            <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
            <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
            <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
            <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
            <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</if>
        </where>
    </select>

    <select id="selectCount" resultType="Integer">
        SELECT COUNT(1) FROM DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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 DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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 DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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 DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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 DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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 DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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.DcParameter">
        INSERT INTO DC_PARAMETER
        <trim prefix="(" suffix=")" suffixOverrides=",">
            HANDLE,
            <if test="dcGroupBo!=null">DC_GROUP_BO,</if>
            <if test="parameterName!=null">PARAMETER_NAME,</if>
            <if test="dataType!=null">DATA_TYPE,</if>
            <if test="status!=null">STATUS,</if>
            <if test="allowMissingValue!=null">ALLOW_MISSING_VALUE,</if>
            <if test="minValue!=null">MIN_VALUE,</if>
            <if test="maxValue!=null">MAX_VALUE,</if>
            <if test="sequence!=null">SEQUENCE,</if>
            <if test="performSpc!=null">PERFORM_SPC,</if>
            <if test="displayChart!=null">DISPLAY_CHART,</if>
            <if test="description!=null">DESCRIPTION,</if>
            <if test="units!=null">UNITS,</if>
            <if test="spcChartBo!=null">SPC_CHART_BO,</if>
            <if test="displayDataInformation!=null">DISPLAY_DATA_INFORMATION,</if>
            <if test="overrideMinMax!=null">OVERRIDE_MIN_MAX,</if>
            <if test="dcValueMask!=null">DC_VALUE_MASK,</if>
            <if test="expressionBuilder!=null">EXPRESSION_BUILDER,</if>
            <if test="requiredDataEntries!=null">REQUIRED_DATA_ENTRIES,</if>
            <if test="optionalDataEntries!=null">OPTIONAL_DATA_ENTRIES,</if>
            <if test="shortRun!=null">SHORT_RUN,</if>
            <if test="opcAcquireAt!=null">OPC_ACQUIRE_AT,</if>
            <if test="opcServer!=null">OPC_SERVER,</if>
            <if test="opcDevice!=null">OPC_DEVICE,</if>
            <if test="opcTag!=null">OPC_TAG,</if>
            <if test="opcServerHostname!=null">OPC_SERVER_HOSTNAME,</if>
            <if test="opcServerModel!=null">OPC_SERVER_MODEL,</if>
            <if test="opcServerProgid!=null">OPC_SERVER_PROGID,</if>
            <if test="opcServerClsid!=null">OPC_SERVER_CLSID,</if>
            <if test="opcDeviceId!=null">OPC_DEVICE_ID,</if>
            <if test="opcTagId!=null">OPC_TAG_ID,</if>
            <if test="scriptBo!=null">SCRIPT_BO,</if>
            <if test="booleanZeroValue!=null">BOOLEAN_ZERO_VALUE,</if>
            <if test="booleanOneValue!=null">BOOLEAN_ONE_VALUE,</if>
            <if test="erpQmCharType!=null">ERP_QM_CHAR_TYPE,</if>
            <if test="erpIsQmCritical!=null">ERP_IS_QM_CRITICAL,</if>
            <if test="softLimitCheck!=null">SOFT_LIMIT_CHECK,</if>
            <if test="autoLogNc!=null">AUTO_LOG_NC,</if>
            <if test="ncCodeBo!=null">NC_CODE_BO,</if>
            <if test="dataFieldBo!=null">DATA_FIELD_BO,</if>
            <if test="inspectionSampleSize!=null">INSPECTION_SAMPLE_SIZE,</if>
            <if test="targetValue!=null">TARGET_VALUE,</if>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            <if test="dcGroupBo!=null">#{dcGroupBo},</if>
            <if test="parameterName!=null">#{parameterName},</if>
            <if test="dataType!=null">#{dataType},</if>
            <if test="status!=null">#{status},</if>
            <if test="allowMissingValue!=null">#{allowMissingValue},</if>
            <if test="minValue!=null">#{minValue},</if>
            <if test="maxValue!=null">#{maxValue},</if>
            <if test="sequence!=null">#{sequence},</if>
            <if test="performSpc!=null">#{performSpc},</if>
            <if test="displayChart!=null">#{displayChart},</if>
            <if test="description!=null">#{description},</if>
            <if test="units!=null">#{units},</if>
            <if test="spcChartBo!=null">#{spcChartBo},</if>
            <if test="displayDataInformation!=null">#{displayDataInformation},</if>
            <if test="overrideMinMax!=null">#{overrideMinMax},</if>
            <if test="dcValueMask!=null">#{dcValueMask},</if>
            <if test="expressionBuilder!=null">#{expressionBuilder},</if>
            <if test="requiredDataEntries!=null">#{requiredDataEntries},</if>
            <if test="optionalDataEntries!=null">#{optionalDataEntries},</if>
            <if test="shortRun!=null">#{shortRun},</if>
            <if test="opcAcquireAt!=null">#{opcAcquireAt},</if>
            <if test="opcServer!=null">#{opcServer},</if>
            <if test="opcDevice!=null">#{opcDevice},</if>
            <if test="opcTag!=null">#{opcTag},</if>
            <if test="opcServerHostname!=null">#{opcServerHostname},</if>
            <if test="opcServerModel!=null">#{opcServerModel},</if>
            <if test="opcServerProgid!=null">#{opcServerProgid},</if>
            <if test="opcServerClsid!=null">#{opcServerClsid},</if>
            <if test="opcDeviceId!=null">#{opcDeviceId},</if>
            <if test="opcTagId!=null">#{opcTagId},</if>
            <if test="scriptBo!=null">#{scriptBo},</if>
            <if test="booleanZeroValue!=null">#{booleanZeroValue},</if>
            <if test="booleanOneValue!=null">#{booleanOneValue},</if>
            <if test="erpQmCharType!=null">#{erpQmCharType},</if>
            <if test="erpIsQmCritical!=null">#{erpIsQmCritical},</if>
            <if test="softLimitCheck!=null">#{softLimitCheck},</if>
            <if test="autoLogNc!=null">#{autoLogNc},</if>
            <if test="ncCodeBo!=null">#{ncCodeBo},</if>
            <if test="dataFieldBo!=null">#{dataFieldBo},</if>
            <if test="inspectionSampleSize!=null">#{inspectionSampleSize},</if>
            <if test="targetValue!=null">#{targetValue},</if>
        </trim>
    </insert>

    <insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.DcParameter">
        INSERT INTO DC_PARAMETER
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <include refid="Base_Column_List"></include>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            #{dcGroupBo},
            #{parameterName},
            #{dataType},
            #{status},
            #{allowMissingValue},
            #{minValue},
            #{maxValue},
            #{sequence},
            #{performSpc},
            #{displayChart},
            #{description},
            #{units},
            #{spcChartBo},
            #{displayDataInformation},
            #{overrideMinMax},
            #{dcValueMask},
            #{expressionBuilder},
            #{requiredDataEntries},
            #{optionalDataEntries},
            #{shortRun},
            #{opcAcquireAt},
            #{opcServer},
            #{opcDevice},
            #{opcTag},
            #{opcServerHostname},
            #{opcServerModel},
            #{opcServerProgid},
            #{opcServerClsid},
            #{opcDeviceId},
            #{opcTagId},
            #{scriptBo},
            #{booleanZeroValue},
            #{booleanOneValue},
            #{erpQmCharType},
            #{erpIsQmCritical},
            #{softLimitCheck},
            #{autoLogNc},
            #{ncCodeBo},
            #{dataFieldBo},
            #{inspectionSampleSize},
            #{targetValue},
        </trim>
    </insert>






    <update id="update">
        UPDATE DC_PARAMETER <trim prefix="SET" suffixOverrides=",">
        <if test="et.handle!=null">HANDLE=#{et.handle},</if>
        <if test="et.dcGroupBo!=null">DC_GROUP_BO=#{et.dcGroupBo},</if>
        <if test="et.parameterName!=null">PARAMETER_NAME=#{et.parameterName},</if>
        <if test="et.dataType!=null">DATA_TYPE=#{et.dataType},</if>
        <if test="et.status!=null">STATUS=#{et.status},</if>
        <if test="et.allowMissingValue!=null">ALLOW_MISSING_VALUE=#{et.allowMissingValue},</if>
        <if test="et.minValue!=null">MIN_VALUE=#{et.minValue},</if>
        <if test="et.maxValue!=null">MAX_VALUE=#{et.maxValue},</if>
        <if test="et.sequence!=null">SEQUENCE=#{et.sequence},</if>
        <if test="et.performSpc!=null">PERFORM_SPC=#{et.performSpc},</if>
        <if test="et.displayChart!=null">DISPLAY_CHART=#{et.displayChart},</if>
        <if test="et.description!=null">DESCRIPTION=#{et.description},</if>
        <if test="et.units!=null">UNITS=#{et.units},</if>
        <if test="et.spcChartBo!=null">SPC_CHART_BO=#{et.spcChartBo},</if>
        <if test="et.displayDataInformation!=null">DISPLAY_DATA_INFORMATION=#{et.displayDataInformation},</if>
        <if test="et.overrideMinMax!=null">OVERRIDE_MIN_MAX=#{et.overrideMinMax},</if>
        <if test="et.dcValueMask!=null">DC_VALUE_MASK=#{et.dcValueMask},</if>
        <if test="et.expressionBuilder!=null">EXPRESSION_BUILDER=#{et.expressionBuilder},</if>
        <if test="et.requiredDataEntries!=null">REQUIRED_DATA_ENTRIES=#{et.requiredDataEntries},</if>
        <if test="et.optionalDataEntries!=null">OPTIONAL_DATA_ENTRIES=#{et.optionalDataEntries},</if>
        <if test="et.shortRun!=null">SHORT_RUN=#{et.shortRun},</if>
        <if test="et.opcAcquireAt!=null">OPC_ACQUIRE_AT=#{et.opcAcquireAt},</if>
        <if test="et.opcServer!=null">OPC_SERVER=#{et.opcServer},</if>
        <if test="et.opcDevice!=null">OPC_DEVICE=#{et.opcDevice},</if>
        <if test="et.opcTag!=null">OPC_TAG=#{et.opcTag},</if>
        <if test="et.opcServerHostname!=null">OPC_SERVER_HOSTNAME=#{et.opcServerHostname},</if>
        <if test="et.opcServerModel!=null">OPC_SERVER_MODEL=#{et.opcServerModel},</if>
        <if test="et.opcServerProgid!=null">OPC_SERVER_PROGID=#{et.opcServerProgid},</if>
        <if test="et.opcServerClsid!=null">OPC_SERVER_CLSID=#{et.opcServerClsid},</if>
        <if test="et.opcDeviceId!=null">OPC_DEVICE_ID=#{et.opcDeviceId},</if>
        <if test="et.opcTagId!=null">OPC_TAG_ID=#{et.opcTagId},</if>
        <if test="et.scriptBo!=null">SCRIPT_BO=#{et.scriptBo},</if>
        <if test="et.booleanZeroValue!=null">BOOLEAN_ZERO_VALUE=#{et.booleanZeroValue},</if>
        <if test="et.booleanOneValue!=null">BOOLEAN_ONE_VALUE=#{et.booleanOneValue},</if>
        <if test="et.erpQmCharType!=null">ERP_QM_CHAR_TYPE=#{et.erpQmCharType},</if>
        <if test="et.erpIsQmCritical!=null">ERP_IS_QM_CRITICAL=#{et.erpIsQmCritical},</if>
        <if test="et.softLimitCheck!=null">SOFT_LIMIT_CHECK=#{et.softLimitCheck},</if>
        <if test="et.autoLogNc!=null">AUTO_LOG_NC=#{et.autoLogNc},</if>
        <if test="et.ncCodeBo!=null">NC_CODE_BO=#{et.ncCodeBo},</if>
        <if test="et.dataFieldBo!=null">DATA_FIELD_BO=#{et.dataFieldBo},</if>
        <if test="et.inspectionSampleSize!=null">INSPECTION_SAMPLE_SIZE=#{et.inspectionSampleSize},</if>
        <if test="et.targetValue!=null">TARGET_VALUE=#{et.targetValue},</if>
    </trim>
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    HANDLE=#{ew.entity.handle}
                    <if test="ew.entity.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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 DC_PARAMETER
        <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 DC_PARAMETER
        <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.dcGroupBo!=null"> AND DC_GROUP_BO=#{ew.entity.dcGroupBo}</if>
                    <if test="ew.entity.parameterName!=null"> AND PARAMETER_NAME=#{ew.entity.parameterName}</if>
                    <if test="ew.entity.dataType!=null"> AND DATA_TYPE=#{ew.entity.dataType}</if>
                    <if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
                    <if test="ew.entity.allowMissingValue!=null"> AND ALLOW_MISSING_VALUE=#{ew.entity.allowMissingValue}</if>
                    <if test="ew.entity.minValue!=null"> AND MIN_VALUE=#{ew.entity.minValue}</if>
                    <if test="ew.entity.maxValue!=null"> AND MAX_VALUE=#{ew.entity.maxValue}</if>
                    <if test="ew.entity.sequence!=null"> AND SEQUENCE=#{ew.entity.sequence}</if>
                    <if test="ew.entity.performSpc!=null"> AND PERFORM_SPC=#{ew.entity.performSpc}</if>
                    <if test="ew.entity.displayChart!=null"> AND DISPLAY_CHART=#{ew.entity.displayChart}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.units!=null"> AND UNITS=#{ew.entity.units}</if>
                    <if test="ew.entity.spcChartBo!=null"> AND SPC_CHART_BO=#{ew.entity.spcChartBo}</if>
                    <if test="ew.entity.displayDataInformation!=null"> AND DISPLAY_DATA_INFORMATION=#{ew.entity.displayDataInformation}</if>
                    <if test="ew.entity.overrideMinMax!=null"> AND OVERRIDE_MIN_MAX=#{ew.entity.overrideMinMax}</if>
                    <if test="ew.entity.dcValueMask!=null"> AND DC_VALUE_MASK=#{ew.entity.dcValueMask}</if>
                    <if test="ew.entity.expressionBuilder!=null"> AND EXPRESSION_BUILDER=#{ew.entity.expressionBuilder}</if>
                    <if test="ew.entity.requiredDataEntries!=null"> AND REQUIRED_DATA_ENTRIES=#{ew.entity.requiredDataEntries}</if>
                    <if test="ew.entity.optionalDataEntries!=null"> AND OPTIONAL_DATA_ENTRIES=#{ew.entity.optionalDataEntries}</if>
                    <if test="ew.entity.shortRun!=null"> AND SHORT_RUN=#{ew.entity.shortRun}</if>
                    <if test="ew.entity.opcAcquireAt!=null"> AND OPC_ACQUIRE_AT=#{ew.entity.opcAcquireAt}</if>
                    <if test="ew.entity.opcServer!=null"> AND OPC_SERVER=#{ew.entity.opcServer}</if>
                    <if test="ew.entity.opcDevice!=null"> AND OPC_DEVICE=#{ew.entity.opcDevice}</if>
                    <if test="ew.entity.opcTag!=null"> AND OPC_TAG=#{ew.entity.opcTag}</if>
                    <if test="ew.entity.opcServerHostname!=null"> AND OPC_SERVER_HOSTNAME=#{ew.entity.opcServerHostname}</if>
                    <if test="ew.entity.opcServerModel!=null"> AND OPC_SERVER_MODEL=#{ew.entity.opcServerModel}</if>
                    <if test="ew.entity.opcServerProgid!=null"> AND OPC_SERVER_PROGID=#{ew.entity.opcServerProgid}</if>
                    <if test="ew.entity.opcServerClsid!=null"> AND OPC_SERVER_CLSID=#{ew.entity.opcServerClsid}</if>
                    <if test="ew.entity.opcDeviceId!=null"> AND OPC_DEVICE_ID=#{ew.entity.opcDeviceId}</if>
                    <if test="ew.entity.opcTagId!=null"> AND OPC_TAG_ID=#{ew.entity.opcTagId}</if>
                    <if test="ew.entity.scriptBo!=null"> AND SCRIPT_BO=#{ew.entity.scriptBo}</if>
                    <if test="ew.entity.booleanZeroValue!=null"> AND BOOLEAN_ZERO_VALUE=#{ew.entity.booleanZeroValue}</if>
                    <if test="ew.entity.booleanOneValue!=null"> AND BOOLEAN_ONE_VALUE=#{ew.entity.booleanOneValue}</if>
                    <if test="ew.entity.erpQmCharType!=null"> AND ERP_QM_CHAR_TYPE=#{ew.entity.erpQmCharType}</if>
                    <if test="ew.entity.erpIsQmCritical!=null"> AND ERP_IS_QM_CRITICAL=#{ew.entity.erpIsQmCritical}</if>
                    <if test="ew.entity.softLimitCheck!=null"> AND SOFT_LIMIT_CHECK=#{ew.entity.softLimitCheck}</if>
                    <if test="ew.entity.autoLogNc!=null"> AND AUTO_LOG_NC=#{ew.entity.autoLogNc}</if>
                    <if test="ew.entity.ncCodeBo!=null"> AND NC_CODE_BO=#{ew.entity.ncCodeBo}</if>
                    <if test="ew.entity.dataFieldBo!=null"> AND DATA_FIELD_BO=#{ew.entity.dataFieldBo}</if>
                    <if test="ew.entity.inspectionSampleSize!=null"> AND INSPECTION_SAMPLE_SIZE=#{ew.entity.inspectionSampleSize}</if>
                    <if test="ew.entity.targetValue!=null"> AND TARGET_VALUE=#{ew.entity.targetValue}</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标准查询/修改/删除 -->

    <!--自定义sql-->
    <select id="getDcParameterByDcGroupBo" resultType="com.foreverwin.mesnac.meapi.model.DcParameter">
        SELECT * FROM WIP.DC_PARAMETER DP WHERE DP.DC_GROUP_BO = #{dcGroupBo}
    </select>

    <!--自定义sql-->

</mapper>
