<?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.shkj.wms.mapper.BusinDataTaskErrmsgMapper">
    
    <resultMap type="BusinDataTaskErrmsg" id="BusinDataTaskErrmsgResult">
        <result property="id"    column="id"    />
        <result property="taskCode"    column="task_code"    />
        <result property="taskType"    column="task_type"    />
        <result property="errMsg"    column="err_msg"    />
        <result property="taskPath"    column="task_path"    />
        <result property="errTime"    column="err_time"    />
        <result property="devId"    column="dev_id"    />
        <result property="devCode"    column="dev_code"    />
        <result property="devType"    column="dev_type"    />
        <result property="distinction"    column="distinction"    />
        <result property="taskId"    column="task_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectBusinDataTaskErrmsgVo">
        select id, task_code, task_type, err_msg, task_path, err_time, dev_id, dev_code, dev_type, distinction, task_id, create_time, update_time from busin_data_task_errmsg
    </sql>

    <select id="selectBusinDataTaskErrmsgList" parameterType="BusinDataTaskErrmsg" resultMap="BusinDataTaskErrmsgResult">
        <include refid="selectBusinDataTaskErrmsgVo"/>
        <where>  
            <if test="taskCode != null  and taskCode != ''"> and task_code = #{taskCode}</if>
            <if test="taskType != null  and taskType != ''"> and task_type = #{taskType}</if>
            <if test="errMsg != null  and errMsg != ''"> and err_msg = #{errMsg}</if>
            <if test="taskPath != null  and taskPath != ''"> and task_path = #{taskPath}</if>
            <if test="errTime != null "> and err_time = #{errTime}</if>
            <if test="devId != null "> and dev_id = #{devId}</if>
            <if test="devCode != null  and devCode != ''"> and dev_code = #{devCode}</if>
            <if test="devType != null  and devType != ''"> and dev_type = #{devType}</if>
            <if test="distinction != null  and distinction != ''"> and distinction = #{distinction}</if>
            <if test="taskId != null "> and task_id = #{taskId}</if>
        </where>
    </select>
    
    <select id="selectBusinDataTaskErrmsgById" parameterType="Long" resultMap="BusinDataTaskErrmsgResult">
        <include refid="selectBusinDataTaskErrmsgVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertBusinDataTaskErrmsg" parameterType="BusinDataTaskErrmsg" useGeneratedKeys="true" keyProperty="id">
        insert into busin_data_task_errmsg
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskCode != null">task_code,</if>
            <if test="taskType != null">task_type,</if>
            <if test="errMsg != null">err_msg,</if>
            <if test="taskPath != null">task_path,</if>
            <if test="errTime != null">err_time,</if>
            <if test="devId != null">dev_id,</if>
            <if test="devCode != null">dev_code,</if>
            <if test="devType != null">dev_type,</if>
            <if test="distinction != null">distinction,</if>
            <if test="taskId != null">task_id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskCode != null">#{taskCode},</if>
            <if test="taskType != null">#{taskType},</if>
            <if test="errMsg != null">#{errMsg},</if>
            <if test="taskPath != null">#{taskPath},</if>
            <if test="errTime != null">#{errTime},</if>
            <if test="devId != null">#{devId},</if>
            <if test="devCode != null">#{devCode},</if>
            <if test="devType != null">#{devType},</if>
            <if test="distinction != null">#{distinction},</if>
            <if test="taskId != null">#{taskId},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>

    <update id="updateBusinDataTaskErrmsg" parameterType="BusinDataTaskErrmsg">
        update busin_data_task_errmsg
        <trim prefix="SET" suffixOverrides=",">
            <if test="taskCode != null">task_code = #{taskCode},</if>
            <if test="taskType != null">task_type = #{taskType},</if>
            <if test="errMsg != null">err_msg = #{errMsg},</if>
            <if test="taskPath != null">task_path = #{taskPath},</if>
            <if test="errTime != null">err_time = #{errTime},</if>
            <if test="devId != null">dev_id = #{devId},</if>
            <if test="devCode != null">dev_code = #{devCode},</if>
            <if test="devType != null">dev_type = #{devType},</if>
            <if test="distinction != null">distinction = #{distinction},</if>
            <if test="taskId != null">task_id = #{taskId},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteBusinDataTaskErrmsgById" parameterType="Long">
        delete from busin_data_task_errmsg where id = #{id}
    </delete>

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