<?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.xisc.pm.infra.mapper.PmCmdRecordMapper">


    <sql id = "BaseSql">
        PCR.PM_CMD_RECORD_ID,
        PCR.OPERATION_NAME,
        PCR.OPERATION_ID,
        PCR.OPERATION_TIME,
        PCR.PONO_SLAB_NO,
        PCR.TMP_SLAB_NO,
        PCR.MAT_DESIGN_KIND,
        PCR.VIRTUAL_SLAB_NO,
        PCR.SLAB_NO,
        PCR.PLATE_NO,
        PCR.TENANT_ID,
        PCR.ATTRIBUTE1,
        PCR.ATTRIBUTE2,
        PCR.ATTRIBUTE3,
        PCR.ATTRIBUTE4,
        PCR.ATTRIBUTE5,
        PCR.creation_date,        PCR.created_by,        PCR.last_updated_by,        PCR.last_update_date,        PCR.object_version_number
    </sql>

    <select id = "selectList" resultType = "com.xisc.pm.domain.entity.PmCmdRecord">
        select
        <include refid = "BaseSql"/>
        from PM_CMD_RECORD PCR
        <where>
            <if test="pmCmdRecordId !=null">
                and PCR.PM_CMD_RECORD_ID = #{pmCmdRecordId,jdbcType = INTEGER}
            </if>
            <if test="operationName !=null">
                and PCR.OPERATION_NAME = #{operationName,jdbcType = VARCHAR}
            </if>
            <if test="operationId !=null">
                and PCR.OPERATION_ID = #{operationId,jdbcType = VARCHAR}
            </if>
            <if test="operationTime !=null">
                and PCR.OPERATION_TIME = #{operationTime,jdbcType = OTHER}
            </if>
            <if test="ponoSlabNo !=null">
                and PCR.PONO_SLAB_NO = #{ponoSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="tmpSlabNo !=null">
                and PCR.TMP_SLAB_NO = #{tmpSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="matDesignKind !=null">
                and PCR.MAT_DESIGN_KIND = #{matDesignKind,jdbcType = VARCHAR}
            </if>
            <if test="virtualSlabNo !=null">
                and PCR.VIRTUAL_SLAB_NO = #{virtualSlabNo,jdbcType = VARCHAR}
            </if>
            <if test="slabNo !=null">
                and PCR.SLAB_NO = #{slabNo,jdbcType = VARCHAR}
            </if>
            <if test="plateNo !=null">
                and PCR.PLATE_NO = #{plateNo,jdbcType = VARCHAR}
            </if>
            <if test="tenantId !=null">
                and PCR.TENANT_ID = #{tenantId,jdbcType = INTEGER}
            </if>
            <if test="attribute1 !=null">
                and PCR.ATTRIBUTE1 = #{attribute1,jdbcType = VARCHAR}
            </if>
            <if test="attribute2 !=null">
                and PCR.ATTRIBUTE2 = #{attribute2,jdbcType = VARCHAR}
            </if>
            <if test="attribute3 !=null">
                and PCR.ATTRIBUTE3 = #{attribute3,jdbcType = VARCHAR}
            </if>
            <if test="attribute4 !=null">
                and PCR.ATTRIBUTE4 = #{attribute4,jdbcType = VARCHAR}
            </if>
            <if test="attribute5 !=null">
                and PCR.ATTRIBUTE5 = #{attribute5,jdbcType = VARCHAR}
            </if>
        </where>
    </select>
</mapper>

