<?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.bonus.sgzb.material.mapper.ApplyInfoMapper">
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.material.domain.LeaseApplyInfo" useGeneratedKeys="true">
        insert into lease_apply_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="code != null">
                code,
            </if>
            <if test="taskId != null">
                task_id,
            </if>
            <if test="leasePerson != null and leasePerson != ''">
                lease_person,
            </if>
            <if test="phone != null and phone != ''">
                phone,
            </if>
            <if test="type != null and type != ''">
                `type`,
            </if>
            <if test="companyAuditBy != null">
                company_audit_by,
            </if>
            <if test="companyAuditTime != null and companyAuditTime != ''">
                company_audit_time,
            </if>
            <if test="companyAuditRemark != null and companyAuditRemark != ''">
                company_audit_remark,
            </if>
            <if test="deptAuditBy != null">
                dept_audit_by,
            </if>
            <if test="deptAuditTime != null and deptAuditTime != ''">
                dept_audit_time,
            </if>
            <if test="deptAuditRemark != null and deptAuditRemark != ''">
                dept_audit_remark,
            </if>
            <if test="createBy != null and createBy != ''">
                create_by,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="updateBy != null and updateBy != ''">
                update_by,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
            <if test="remark != null and remark != ''">
                remark,
            </if>
            <if test="companyId != null">
                company_id,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="code != null">
                #{code,jdbcType=VARCHAR},
            </if>
            <if test="taskId != null">
                #{taskId,jdbcType=INTEGER},
            </if>
            <if test="leasePerson != null and leasePerson != ''">
                #{leasePerson,jdbcType=VARCHAR},
            </if>
            <if test="phone != null and phone != ''">
                #{phone,jdbcType=VARCHAR},
            </if>
            <if test="type != null and type != ''">
                #{type,jdbcType=VARCHAR},
            </if>
            <if test="companyAuditBy != null">
                #{companyAuditBy,jdbcType=INTEGER},
            </if>
            <if test="companyAuditTime != null and companyAuditTime != ''">
                #{companyAuditTime,jdbcType=VARCHAR},
            </if>
            <if test="companyAuditRemark != null and companyAuditRemark != ''">
                #{companyAuditRemark,jdbcType=VARCHAR},
            </if>
            <if test="deptAuditBy != null">
                #{deptAuditBy,jdbcType=INTEGER},
            </if>
            <if test="deptAuditTime != null and deptAuditTime != ''">
                #{deptAuditTime,jdbcType=VARCHAR},
            </if>
            <if test="deptAuditRemark != null and deptAuditRemark != ''">
                #{deptAuditRemark,jdbcType=VARCHAR},
            </if>
            <if test="createBy != null and createBy != ''">
                #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null and updateBy != ''">
                #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="remark != null and remark != ''">
                #{remark,jdbcType=VARCHAR},
            </if>
            <if test="companyId != null">
                #{companyId,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
    <select id="selectIdByTaskId" resultType="com.bonus.sgzb.material.domain.LeaseApplyInfo">
        select * from lease_apply_info where task_id = #{id}
    </select>
</mapper>