<?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.fizz.business.mapper.SetupFurTempMapper">

    <resultMap type="SetupFurTemp" id="SetupFurTempResult">
        <result property="steelGrade"    column="steel_grade"    />
        <result property="value1"    column="value1"    />
        <result property="value2"    column="value2"    />
        <result property="value3"    column="value3"    />
        <result property="value4"    column="value4"    />
        <result property="value5"    column="value5"    />
        <result property="value6"    column="value6"    />
        <result property="value7"    column="value7"    />
        <result property="value8"    column="value8"    />
        <result property="value9"    column="value9"    />
        <result property="value10"    column="value10"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>

    <sql id="selectSetupFurTempVo">
        select steel_grade, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, update_time, create_time from setup_fur_temp
    </sql>

    <select id="selectSetupFurTempList" parameterType="SetupFurTemp" resultMap="SetupFurTempResult">
        <include refid="selectSetupFurTempVo"/>
        <where>
            <if test="value1 != null "> and value1 = #{value1}</if>
            <if test="value2 != null "> and value2 = #{value2}</if>
            <if test="value3 != null "> and value3 = #{value3}</if>
        </where>
    </select>

    <select id="selectSetupFurTempBySteelGrade" parameterType="String" resultMap="SetupFurTempResult">
        <include refid="selectSetupFurTempVo"/>
        where steel_grade = #{steelGrade}
    </select>

    <insert id="insertSetupFurTemp" parameterType="SetupFurTemp">
        insert into setup_fur_temp
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="steelGrade != null">steel_grade,</if>
            <if test="value1 != null">value1,</if>
            <if test="value2 != null">value2,</if>
            <if test="value3 != null">value3,</if>
            <if test="value4 != null">value4,</if>
            <if test="value5 != null">value5,</if>
            <if test="value6 != null">value6,</if>
            <if test="value7 != null">value7,</if>
            <if test="value8 != null">value8,</if>
            <if test="value9 != null">value9,</if>
            <if test="value10 != null">value10,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createTime != null">create_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="steelGrade != null">#{steelGrade},</if>
            <if test="value1 != null">#{value1},</if>
            <if test="value2 != null">#{value2},</if>
            <if test="value3 != null">#{value3},</if>
            <if test="value4 != null">#{value4},</if>
            <if test="value5 != null">#{value5},</if>
            <if test="value6 != null">#{value6},</if>
            <if test="value7 != null">#{value7},</if>
            <if test="value8 != null">#{value8},</if>
            <if test="value9 != null">#{value9},</if>
            <if test="value10 != null">#{value10},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createTime != null">#{createTime},</if>
        </trim>
    </insert>

    <update id="updateSetupFurTemp" parameterType="SetupFurTemp">
        update setup_fur_temp
        <trim prefix="SET" suffixOverrides=",">
            <if test="value1 != null">value1 = #{value1},</if>
            <if test="value2 != null">value2 = #{value2},</if>
            <if test="value3 != null">value3 = #{value3},</if>
            <if test="value4 != null">value4 = #{value4},</if>
            <if test="value5 != null">value5 = #{value5},</if>
            <if test="value6 != null">value6 = #{value6},</if>
            <if test="value7 != null">value7 = #{value7},</if>
            <if test="value8 != null">value8 = #{value8},</if>
            <if test="value9 != null">value9 = #{value9},</if>
            <if test="value10 != null">value10 = #{value10},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
        </trim>
        where steel_grade = #{steelGrade}
    </update>

    <delete id="deleteSetupFurTempBySteelGrade" parameterType="String">
        delete from setup_fur_temp where steel_grade = #{steelGrade}
    </delete>

    <delete id="deleteSetupFurTempBySteelGrades" parameterType="String">
        delete from setup_fur_temp where steel_grade in
        <foreach item="steelGrade" collection="array" open="(" separator="," close=")">
            #{steelGrade}
        </foreach>
    </delete>
</mapper>