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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.DcGroup">
        <result column="HANDLE" property="handle" />
        <result column="DC_GROUP" property="dcGroup" />
        <result column="DESCRIPTION" property="description" />
        <result column="SITE" property="site" />
        <result column="COLLECT_DATA_AT" property="collectDataAt" />
        <result column="CUSTOM_BUTTON_ID" property="customButtonId" />
        <result column="PASS_FAIL_GROUP" property="passFailGroup" />
        <result column="REVISION" property="revision" />
        <result column="CURRENT_REVISION" property="currentRevision" />
        <result column="STATUS_BO" property="statusBo" />
        <result column="AUTHENTICATION_REQUIRED" property="authenticationRequired" />
        <result column="ERP" property="erp" />
        <result column="COLLECT_METHOD" property="collectMethod" />
        <result column="COLLECTION_TYPE" property="collectionType" />
        <result column="CREATED_DATE_TIME" property="createdDateTime" />
        <result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
        <result column="ERP_INSPECTION" property="erpInspection" />
        <result column="ERP_WHOLE_GROUP_INSPECTION" property="erpWholeGroupInspection" />
        <result column="ME_EVAL_INSPECTION" property="meEvalInspection" />
        <result column="PASS_FAIL_NUMBER" property="passFailNumber" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        HANDLE, DC_GROUP, DESCRIPTION, SITE, COLLECT_DATA_AT, CUSTOM_BUTTON_ID, PASS_FAIL_GROUP, REVISION, CURRENT_REVISION, STATUS_BO, AUTHENTICATION_REQUIRED, ERP, COLLECT_METHOD, COLLECTION_TYPE, CREATED_DATE_TIME, MODIFIED_DATE_TIME, ERP_INSPECTION, ERP_WHOLE_GROUP_INSPECTION, ME_EVAL_INSPECTION, PASS_FAIL_NUMBER
    </sql>

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

    <select id="selectByMap" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"></include>
        FROM DC_GROUP
        <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_GROUP
        <where>
            <if test="ew.entity.handle!=null">
              HANDLE=#{ew.handle}
            </if>
            <if test="ew.entity.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
            <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
            <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
            <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
            <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
            <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
            <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
            <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
            <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
            <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
            <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
            <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
            <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
            <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
            <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
            <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</if>
        </where>
    </select>

    <select id="selectCount" resultType="Integer">
        SELECT COUNT(1) FROM DC_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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.DcGroup">
        INSERT INTO DC_GROUP
        <trim prefix="(" suffix=")" suffixOverrides=",">
            HANDLE,
            <if test="dcGroup!=null">DC_GROUP,</if>
            <if test="description!=null">DESCRIPTION,</if>
            <if test="site!=null">SITE,</if>
            <if test="collectDataAt!=null">COLLECT_DATA_AT,</if>
            <if test="customButtonId!=null">CUSTOM_BUTTON_ID,</if>
            <if test="passFailGroup!=null">PASS_FAIL_GROUP,</if>
            <if test="revision!=null">REVISION,</if>
            <if test="currentRevision!=null">CURRENT_REVISION,</if>
            <if test="statusBo!=null">STATUS_BO,</if>
            <if test="authenticationRequired!=null">AUTHENTICATION_REQUIRED,</if>
            <if test="erp!=null">ERP,</if>
            <if test="collectMethod!=null">COLLECT_METHOD,</if>
            <if test="collectionType!=null">COLLECTION_TYPE,</if>
            <if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
            <if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
            <if test="erpInspection!=null">ERP_INSPECTION,</if>
            <if test="erpWholeGroupInspection!=null">ERP_WHOLE_GROUP_INSPECTION,</if>
            <if test="meEvalInspection!=null">ME_EVAL_INSPECTION,</if>
            <if test="passFailNumber!=null">PASS_FAIL_NUMBER,</if>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            <if test="dcGroup!=null">#{dcGroup},</if>
            <if test="description!=null">#{description},</if>
            <if test="site!=null">#{site},</if>
            <if test="collectDataAt!=null">#{collectDataAt},</if>
            <if test="customButtonId!=null">#{customButtonId},</if>
            <if test="passFailGroup!=null">#{passFailGroup},</if>
            <if test="revision!=null">#{revision},</if>
            <if test="currentRevision!=null">#{currentRevision},</if>
            <if test="statusBo!=null">#{statusBo},</if>
            <if test="authenticationRequired!=null">#{authenticationRequired},</if>
            <if test="erp!=null">#{erp},</if>
            <if test="collectMethod!=null">#{collectMethod},</if>
            <if test="collectionType!=null">#{collectionType},</if>
            <if test="createdDateTime!=null">#{createdDateTime},</if>
            <if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
            <if test="erpInspection!=null">#{erpInspection},</if>
            <if test="erpWholeGroupInspection!=null">#{erpWholeGroupInspection},</if>
            <if test="meEvalInspection!=null">#{meEvalInspection},</if>
            <if test="passFailNumber!=null">#{passFailNumber},</if>
        </trim>
    </insert>

    <insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.DcGroup">
        INSERT INTO DC_GROUP
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <include refid="Base_Column_List"></include>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{handle},
            #{dcGroup},
            #{description},
            #{site},
            #{collectDataAt},
            #{customButtonId},
            #{passFailGroup},
            #{revision},
            #{currentRevision},
            #{statusBo},
            #{authenticationRequired},
            #{erp},
            #{collectMethod},
            #{collectionType},
            #{createdDateTime},
            #{modifiedDateTime},
            #{erpInspection},
            #{erpWholeGroupInspection},
            #{meEvalInspection},
            #{passFailNumber},
        </trim>
    </insert>






    <update id="update">
        UPDATE DC_GROUP <trim prefix="SET" suffixOverrides=",">
        <if test="et.handle!=null">HANDLE=#{et.handle},</if>
        <if test="et.dcGroup!=null">DC_GROUP=#{et.dcGroup},</if>
        <if test="et.description!=null">DESCRIPTION=#{et.description},</if>
        <if test="et.site!=null">SITE=#{et.site},</if>
        <if test="et.collectDataAt!=null">COLLECT_DATA_AT=#{et.collectDataAt},</if>
        <if test="et.customButtonId!=null">CUSTOM_BUTTON_ID=#{et.customButtonId},</if>
        <if test="et.passFailGroup!=null">PASS_FAIL_GROUP=#{et.passFailGroup},</if>
        <if test="et.revision!=null">REVISION=#{et.revision},</if>
        <if test="et.currentRevision!=null">CURRENT_REVISION=#{et.currentRevision},</if>
        <if test="et.statusBo!=null">STATUS_BO=#{et.statusBo},</if>
        <if test="et.authenticationRequired!=null">AUTHENTICATION_REQUIRED=#{et.authenticationRequired},</if>
        <if test="et.erp!=null">ERP=#{et.erp},</if>
        <if test="et.collectMethod!=null">COLLECT_METHOD=#{et.collectMethod},</if>
        <if test="et.collectionType!=null">COLLECTION_TYPE=#{et.collectionType},</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.erpInspection!=null">ERP_INSPECTION=#{et.erpInspection},</if>
        <if test="et.erpWholeGroupInspection!=null">ERP_WHOLE_GROUP_INSPECTION=#{et.erpWholeGroupInspection},</if>
        <if test="et.meEvalInspection!=null">ME_EVAL_INSPECTION=#{et.meEvalInspection},</if>
        <if test="et.passFailNumber!=null">PASS_FAIL_NUMBER=#{et.passFailNumber},</if>
    </trim>
        <where>
            <if test="ew!=null">
                <if test="ew.entity!=null">
                    HANDLE=#{ew.entity.handle}
                    <if test="ew.entity.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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_GROUP
        <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_GROUP
        <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.dcGroup!=null"> AND DC_GROUP=#{ew.entity.dcGroup}</if>
                    <if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
                    <if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
                    <if test="ew.entity.collectDataAt!=null"> AND COLLECT_DATA_AT=#{ew.entity.collectDataAt}</if>
                    <if test="ew.entity.customButtonId!=null"> AND CUSTOM_BUTTON_ID=#{ew.entity.customButtonId}</if>
                    <if test="ew.entity.passFailGroup!=null"> AND PASS_FAIL_GROUP=#{ew.entity.passFailGroup}</if>
                    <if test="ew.entity.revision!=null"> AND REVISION=#{ew.entity.revision}</if>
                    <if test="ew.entity.currentRevision!=null"> AND CURRENT_REVISION=#{ew.entity.currentRevision}</if>
                    <if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
                    <if test="ew.entity.authenticationRequired!=null"> AND AUTHENTICATION_REQUIRED=#{ew.entity.authenticationRequired}</if>
                    <if test="ew.entity.erp!=null"> AND ERP=#{ew.entity.erp}</if>
                    <if test="ew.entity.collectMethod!=null"> AND COLLECT_METHOD=#{ew.entity.collectMethod}</if>
                    <if test="ew.entity.collectionType!=null"> AND COLLECTION_TYPE=#{ew.entity.collectionType}</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.erpInspection!=null"> AND ERP_INSPECTION=#{ew.entity.erpInspection}</if>
                    <if test="ew.entity.erpWholeGroupInspection!=null"> AND ERP_WHOLE_GROUP_INSPECTION=#{ew.entity.erpWholeGroupInspection}</if>
                    <if test="ew.entity.meEvalInspection!=null"> AND ME_EVAL_INSPECTION=#{ew.entity.meEvalInspection}</if>
                    <if test="ew.entity.passFailNumber!=null"> AND PASS_FAIL_NUMBER=#{ew.entity.passFailNumber}</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>
