<?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.api.manage.dao.butlerService.SysWorkOrderTimeLimitDao">
    <select id="list" parameterType="java.lang.Integer" resultType="com.api.vo.butlerService.VoWorkOrderTimeLimit">
        select * from sys_work_order_time_limit
    </select>
    <insert id="insert" parameterType="com.api.model.butlerService.SysWorkOrderTimeLimit">
        insert into
        <trim prefix="sys_work_order_time_limit(" suffix=")" suffixOverrides=",">
            name,
            time_limit,
            <if test="remake != null and remake != ''">
                remake,
            </if>
            create_id,
            create_date
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{name},
            #{timeLimit},
            <if test="remake != null and remake != ''">
                #{remake},
            </if>
            #{createId},
            #{createDate}
        </trim>
    </insert>
    <select id="findById" parameterType="java.lang.Integer" resultType="com.api.vo.butlerService.VoWorkOrderTimeLimit">
        select * from sys_work_order_time_limit where id =#{id}
    </select>

    <update id="update" parameterType="com.api.model.butlerService.SysWorkOrderTimeLimit">
        update sys_work_order_time_limit
        <set>
            <if test="name != null and name != ''">
                name = #{name},
            </if>
            <if test="timeLimit != null">
                time_limit = #{timeLimit},
            </if>
            <if test="remake != null and remake != ''">
                remake = #{remake},
            </if>
            modify_id = #{modifyId},
            modify_date = #{modifyDate},
        </set>
        where id = #{id}
    </update>

    <delete id="delete" parameterType="java.lang.Integer">
        delete from sys_work_order_time_limit where id =#{id}
    </delete>
</mapper>