<?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.ruoyi.system.mapper.visit.VisitFreePlanModelMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        <id column="id" jdbcType="VARCHAR" property="id"/>
        <result column="plan_title" jdbcType="VARCHAR" property="planTitle"/>
        <result column="plan_type" jdbcType="VARCHAR" property="planType"/>
        <result column="task_type" jdbcType="VARCHAR" property="taskType"/>
        <result column="plan_status" jdbcType="VARCHAR" property="planStatus"/>
        <result column="plan_wg_code" jdbcType="VARCHAR" property="planWgCode"/>
        <result column="start_time" jdbcType="VARCHAR" property="startTime"/>
        <result column="end_time" jdbcType="VARCHAR" property="endTime"/>
        <result column="unlimited" jdbcType="VARCHAR" property="unlimited"/>
        <result column="plan_all_num" jdbcType="BIGINT" property="planAllNum"/>
        <result column="plan_com_num" jdbcType="BIGINT" property="planComNum"/>
        <result column="plan_shop_num" jdbcType="BIGINT" property="planShopNum"/>
        <result column="plan_house_num" jdbcType="BIGINT" property="planHouseNum"/>
        <result column="plan_people_num" jdbcType="BIGINT" property="planPeopleNum"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
        <result column="is_valid" jdbcType="VARCHAR" property="isValid"/>
        <result column="exception_desc" jdbcType="VARCHAR" property="exceptionDesc"/>
        <result column="visit_type" jdbcType="VARCHAR" property="visitType"/>
    </resultMap>
    <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
               type="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        <result column="plan_explain" jdbcType="LONGVARCHAR" property="planExplain"/>
    </resultMap>
    <sql id="Example_Where_Clause">
        <where>
            <foreach collection="oredCriteria" item="criteria" separator="or">
                <if test="criteria.valid">
                    <trim prefix="(" prefixOverrides="and" suffix=")">
                        <foreach collection="criteria.criteria" item="criterion">
                            <choose>
                                <when test="criterion.noValue">
                                    and ${criterion.condition}
                                </when>
                                <when test="criterion.singleValue">
                                    and ${criterion.condition} #{criterion.value}
                                </when>
                                <when test="criterion.betweenValue">
                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                                </when>
                                <when test="criterion.listValue">
                                    and ${criterion.condition}
                                    <foreach close=")" collection="criterion.value" item="listItem" open="("
                                             separator=",">
                                        #{listItem}
                                    </foreach>
                                </when>
                            </choose>
                        </foreach>
                    </trim>
                </if>
            </foreach>
        </where>
    </sql>
    <sql id="Update_By_Example_Where_Clause">
        <where>
            <foreach collection="example.oredCriteria" item="criteria" separator="or">
                <if test="criteria.valid">
                    <trim prefix="(" prefixOverrides="and" suffix=")">
                        <foreach collection="criteria.criteria" item="criterion">
                            <choose>
                                <when test="criterion.noValue">
                                    and ${criterion.condition}
                                </when>
                                <when test="criterion.singleValue">
                                    and ${criterion.condition} #{criterion.value}
                                </when>
                                <when test="criterion.betweenValue">
                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                                </when>
                                <when test="criterion.listValue">
                                    and ${criterion.condition}
                                    <foreach close=")" collection="criterion.value" item="listItem" open="("
                                             separator=",">
                                        #{listItem}
                                    </foreach>
                                </when>
                            </choose>
                        </foreach>
                    </trim>
                </if>
            </foreach>
        </where>
    </sql>
    <sql id="Base_Column_List">
        id
        , plan_title, plan_type, task_type, plan_status, plan_wg_code, start_time, end_time,
    unlimited, plan_all_num, plan_com_num, plan_shop_num, plan_house_num, plan_people_num,
    create_time, create_by, update_time, update_by, is_valid, exception_desc, visit_type
    </sql>
    <sql id="Blob_Column_List">
        plan_explain
    </sql>
    <select id="selectByExampleWithBLOBs"
            parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModelExample"
            resultMap="ResultMapWithBLOBs">
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List"/>
        ,
        <include refid="Blob_Column_List"/>
        from visit_free_plan_model
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
        <if test="orderByClause != null">
            order by ${orderByClause}
        </if>
    </select>
    <select id="selectByExample"
            parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModelExample"
            resultMap="BaseResultMap">
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List"/>
        from visit_free_plan_model
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
        <if test="orderByClause != null">
            order by ${orderByClause}
        </if>
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
        select
        <include refid="Base_Column_List"/>
        ,
        <include refid="Blob_Column_List"/>
        from visit_free_plan_model
        where id = #{id,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
        delete
        from visit_free_plan_model
        where id = #{id,jdbcType=VARCHAR}
    </delete>
    <delete id="deleteByExample"
            parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModelExample">
        delete from visit_free_plan_model
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </delete>
    <insert id="insert" parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        insert into visit_free_plan_model (id, plan_title, plan_type,
                                          task_type, plan_status, plan_wg_code,
                                          start_time, end_time, unlimited,
                                          plan_all_num, plan_com_num, plan_shop_num,
                                          plan_house_num, plan_people_num,
                                          create_time, create_by, update_time,
                                          update_by, is_valid, exception_desc,
                                          plan_explain, visit_type)
        values (#{id,jdbcType=VARCHAR}, #{planTitle,jdbcType=VARCHAR}, #{planType,jdbcType=VARCHAR},
                #{taskType,jdbcType=VARCHAR}, #{planStatus,jdbcType=VARCHAR}, #{planWgCode,jdbcType=VARCHAR},
                #{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR}, #{unlimited,jdbcType=VARCHAR},
                #{planAllNum,jdbcType=BIGINT}, #{planComNum,jdbcType=BIGINT}, #{planShopNum,jdbcType=BIGINT},
                #{planHouseNum,jdbcType=BIGINT}, #{planPeopleNum,jdbcType=BIGINT},
                #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
                #{updateBy,jdbcType=VARCHAR}, #{isValid,jdbcType=VARCHAR}, #{exceptionDesc,jdbcType=VARCHAR},
                #{planExplain,jdbcType=LONGVARCHAR}, #{visitType,jdbcType=LONGVARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        insert into visit_free_plan_model
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="planTitle != null">
                plan_title,
            </if>
            <if test="planType != null">
                plan_type,
            </if>
            <if test="taskType != null">
                task_type,
            </if>
            <if test="planStatus != null">
                plan_status,
            </if>
            <if test="planWgCode != null">
                plan_wg_code,
            </if>
            <if test="startTime != null">
                start_time,
            </if>
            <if test="endTime != null">
                end_time,
            </if>
            <if test="unlimited != null">
                unlimited,
            </if>
            <if test="planAllNum != null">
                plan_all_num,
            </if>
            <if test="planComNum != null">
                plan_com_num,
            </if>
            <if test="planShopNum != null">
                plan_shop_num,
            </if>
            <if test="planHouseNum != null">
                plan_house_num,
            </if>
            <if test="planPeopleNum != null">
                plan_people_num,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="createBy != null">
                create_by,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
            <if test="updateBy != null">
                update_by,
            </if>
            <if test="isValid != null">
                is_valid,
            </if>
            <if test="exceptionDesc != null">
                exception_desc,
            </if>
            <if test="planExplain != null">
                plan_explain,
            </if>
            <if test="visitType != null">
                visit_type,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=VARCHAR},
            </if>
            <if test="planTitle != null">
                #{planTitle,jdbcType=VARCHAR},
            </if>
            <if test="planType != null">
                #{planType,jdbcType=VARCHAR},
            </if>
            <if test="taskType != null">
                #{taskType,jdbcType=VARCHAR},
            </if>
            <if test="planStatus != null">
                #{planStatus,jdbcType=VARCHAR},
            </if>
            <if test="planWgCode != null">
                #{planWgCode,jdbcType=VARCHAR},
            </if>
            <if test="startTime != null">
                #{startTime,jdbcType=VARCHAR},
            </if>
            <if test="endTime != null">
                #{endTime,jdbcType=VARCHAR},
            </if>
            <if test="unlimited != null">
                #{unlimited,jdbcType=VARCHAR},
            </if>
            <if test="planAllNum != null">
                #{planAllNum,jdbcType=BIGINT},
            </if>
            <if test="planComNum != null">
                #{planComNum,jdbcType=BIGINT},
            </if>
            <if test="planShopNum != null">
                #{planShopNum,jdbcType=BIGINT},
            </if>
            <if test="planHouseNum != null">
                #{planHouseNum,jdbcType=BIGINT},
            </if>
            <if test="planPeopleNum != null">
                #{planPeopleNum,jdbcType=BIGINT},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createBy != null">
                #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="isValid != null">
                #{isValid,jdbcType=VARCHAR},
            </if>
            <if test="exceptionDesc != null">
                #{exceptionDesc,jdbcType=VARCHAR},
            </if>
            <if test="planExplain != null">
                #{planExplain,jdbcType=LONGVARCHAR},
            </if>
            <if test="visitType != null">
                #{visitType,jdbcType=LONGVARCHAR},
            </if>
        </trim>
    </insert>
    <select id="countByExample"
            parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModelExample"
            resultType="java.lang.Long">
        select count(*) from visit_free_plan_model
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </select>
    <update id="updateByExampleSelective" parameterType="map">
        update visit_free_plan_model
        <set>
            <if test="record.id != null">
                id = #{record.id,jdbcType=VARCHAR},
            </if>
            <if test="record.planTitle != null">
                plan_title = #{record.planTitle,jdbcType=VARCHAR},
            </if>
            <if test="record.planType != null">
                plan_type = #{record.planType,jdbcType=VARCHAR},
            </if>
            <if test="record.taskType != null">
                task_type = #{record.taskType,jdbcType=VARCHAR},
            </if>
            <if test="record.planStatus != null">
                plan_status = #{record.planStatus,jdbcType=VARCHAR},
            </if>
            <if test="record.planWgCode != null">
                plan_wg_code = #{record.planWgCode,jdbcType=VARCHAR},
            </if>
            <if test="record.startTime != null">
                start_time = #{record.startTime,jdbcType=VARCHAR},
            </if>
            <if test="record.endTime != null">
                end_time = #{record.endTime,jdbcType=VARCHAR},
            </if>
            <if test="record.unlimited != null">
                unlimited = #{record.unlimited,jdbcType=VARCHAR},
            </if>
            <if test="record.planAllNum != null">
                plan_all_num = #{record.planAllNum,jdbcType=BIGINT},
            </if>
            <if test="record.planComNum != null">
                plan_com_num = #{record.planComNum,jdbcType=BIGINT},
            </if>
            <if test="record.planShopNum != null">
                plan_shop_num = #{record.planShopNum,jdbcType=BIGINT},
            </if>
            <if test="record.planHouseNum != null">
                plan_house_num = #{record.planHouseNum,jdbcType=BIGINT},
            </if>
            <if test="record.planPeopleNum != null">
                plan_people_num = #{record.planPeopleNum,jdbcType=BIGINT},
            </if>
            <if test="record.createTime != null">
                create_time = #{record.createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="record.createBy != null">
                create_by = #{record.createBy,jdbcType=VARCHAR},
            </if>
            <if test="record.updateTime != null">
                update_time = #{record.updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="record.updateBy != null">
                update_by = #{record.updateBy,jdbcType=VARCHAR},
            </if>
            <if test="record.isValid != null">
                is_valid = #{record.isValid,jdbcType=VARCHAR},
            </if>
            <if test="record.exceptionDesc != null">
                exception_desc = #{record.exceptionDesc,jdbcType=VARCHAR},
            </if>
            <if test="record.planExplain != null">
                plan_explain = #{record.planExplain,jdbcType=LONGVARCHAR},
            </if>
            <if test="record.visitType != null">
                visit_type = #{record.visitType,jdbcType=LONGVARCHAR},
            </if>
        </set>
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByExampleWithBLOBs" parameterType="map">
        update visit_free_plan_model
        set id = #{record.id,jdbcType=VARCHAR},
        plan_title = #{record.planTitle,jdbcType=VARCHAR},
        plan_type = #{record.planType,jdbcType=VARCHAR},
        task_type = #{record.taskType,jdbcType=VARCHAR},
        plan_status = #{record.planStatus,jdbcType=VARCHAR},
        plan_wg_code = #{record.planWgCode,jdbcType=VARCHAR},
        start_time = #{record.startTime,jdbcType=VARCHAR},
        end_time = #{record.endTime,jdbcType=VARCHAR},
        unlimited = #{record.unlimited,jdbcType=VARCHAR},
        plan_all_num = #{record.planAllNum,jdbcType=BIGINT},
        plan_com_num = #{record.planComNum,jdbcType=BIGINT},
        plan_shop_num = #{record.planShopNum,jdbcType=BIGINT},
        plan_house_num = #{record.planHouseNum,jdbcType=BIGINT},
        plan_people_num = #{record.planPeopleNum,jdbcType=BIGINT},
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
        create_by = #{record.createBy,jdbcType=VARCHAR},
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
        update_by = #{record.updateBy,jdbcType=VARCHAR},
        is_valid = #{record.isValid,jdbcType=VARCHAR},
        exception_desc = #{record.exceptionDesc,jdbcType=VARCHAR},
        plan_explain = #{record.planExplain,jdbcType=LONGVARCHAR},
        visit_type = #{record.visitType,jdbcType=LONGVARCHAR}
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByExample" parameterType="map">
        update visit_free_plan_model
        set id = #{record.id,jdbcType=VARCHAR},
        plan_title = #{record.planTitle,jdbcType=VARCHAR},
        plan_type = #{record.planType,jdbcType=VARCHAR},
        task_type = #{record.taskType,jdbcType=VARCHAR},
        plan_status = #{record.planStatus,jdbcType=VARCHAR},
        plan_wg_code = #{record.planWgCode,jdbcType=VARCHAR},
        start_time = #{record.startTime,jdbcType=VARCHAR},
        end_time = #{record.endTime,jdbcType=VARCHAR},
        unlimited = #{record.unlimited,jdbcType=VARCHAR},
        plan_all_num = #{record.planAllNum,jdbcType=BIGINT},
        plan_com_num = #{record.planComNum,jdbcType=BIGINT},
        plan_shop_num = #{record.planShopNum,jdbcType=BIGINT},
        plan_house_num = #{record.planHouseNum,jdbcType=BIGINT},
        plan_people_num = #{record.planPeopleNum,jdbcType=BIGINT},
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
        create_by = #{record.createBy,jdbcType=VARCHAR},
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
        update_by = #{record.updateBy,jdbcType=VARCHAR},
        is_valid = #{record.isValid,jdbcType=VARCHAR},
        exception_desc = #{record.exceptionDesc,jdbcType=VARCHAR},
        visit_type = #{record.visitType,jdbcType=VARCHAR}
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByPrimaryKeySelective"
            parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        update visit_free_plan_model
        <set>
            <if test="planTitle != null">
                plan_title = #{planTitle,jdbcType=VARCHAR},
            </if>
            <if test="planType != null">
                plan_type = #{planType,jdbcType=VARCHAR},
            </if>
            <if test="taskType != null">
                task_type = #{taskType,jdbcType=VARCHAR},
            </if>
            <if test="planStatus != null">
                plan_status = #{planStatus,jdbcType=VARCHAR},
            </if>
            <if test="planWgCode != null">
                plan_wg_code = #{planWgCode,jdbcType=VARCHAR},
            </if>
            <if test="startTime != null">
                start_time = #{startTime,jdbcType=VARCHAR},
            </if>
            <if test="endTime != null">
                end_time = #{endTime,jdbcType=VARCHAR},
            </if>
            <if test="unlimited != null">
                unlimited = #{unlimited,jdbcType=VARCHAR},
            </if>
            <if test="planAllNum != null">
                plan_all_num = #{planAllNum,jdbcType=BIGINT},
            </if>
            <if test="planComNum != null">
                plan_com_num = #{planComNum,jdbcType=BIGINT},
            </if>
            <if test="planShopNum != null">
                plan_shop_num = #{planShopNum,jdbcType=BIGINT},
            </if>
            <if test="planHouseNum != null">
                plan_house_num = #{planHouseNum,jdbcType=BIGINT},
            </if>
            <if test="planPeopleNum != null">
                plan_people_num = #{planPeopleNum,jdbcType=BIGINT},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createBy != null">
                create_by = #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                update_by = #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="isValid != null">
                is_valid = #{isValid,jdbcType=VARCHAR},
            </if>
            <if test="exceptionDesc != null">
                exception_desc = #{exceptionDesc,jdbcType=VARCHAR},
            </if>
            <if test="planExplain != null">
                plan_explain = #{planExplain,jdbcType=LONGVARCHAR},
            </if>
            <if test="visitType != null">
                visit_type = #{visitType,jdbcType=LONGVARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKeyWithBLOBs"
            parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        update visit_free_plan_model
        set plan_title      = #{planTitle,jdbcType=VARCHAR},
            plan_type       = #{planType,jdbcType=VARCHAR},
            task_type       = #{taskType,jdbcType=VARCHAR},
            plan_status     = #{planStatus,jdbcType=VARCHAR},
            plan_wg_code    = #{planWgCode,jdbcType=VARCHAR},
            start_time      = #{startTime,jdbcType=VARCHAR},
            end_time        = #{endTime,jdbcType=VARCHAR},
            unlimited       = #{unlimited,jdbcType=VARCHAR},
            plan_all_num    = #{planAllNum,jdbcType=BIGINT},
            plan_com_num    = #{planComNum,jdbcType=BIGINT},
            plan_shop_num   = #{planShopNum,jdbcType=BIGINT},
            plan_house_num  = #{planHouseNum,jdbcType=BIGINT},
            plan_people_num = #{planPeopleNum,jdbcType=BIGINT},
            create_time     = #{createTime,jdbcType=TIMESTAMP},
            create_by       = #{createBy,jdbcType=VARCHAR},
            update_time     = #{updateTime,jdbcType=TIMESTAMP},
            update_by       = #{updateBy,jdbcType=VARCHAR},
            is_valid        = #{isValid,jdbcType=VARCHAR},
            exception_desc  = #{exceptionDesc,jdbcType=VARCHAR},
            plan_explain    = #{planExplain,jdbcType=LONGVARCHAR},
            visit_type    = #{visitType,jdbcType=LONGVARCHAR}
        where id = #{id,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.visit.VisitFreePlanModel">
        update visit_free_plan_model
        set plan_title      = #{planTitle,jdbcType=VARCHAR},
            plan_type       = #{planType,jdbcType=VARCHAR},
            task_type       = #{taskType,jdbcType=VARCHAR},
            plan_status     = #{planStatus,jdbcType=VARCHAR},
            plan_wg_code    = #{planWgCode,jdbcType=VARCHAR},
            start_time      = #{startTime,jdbcType=VARCHAR},
            end_time        = #{endTime,jdbcType=VARCHAR},
            unlimited       = #{unlimited,jdbcType=VARCHAR},
            plan_all_num    = #{planAllNum,jdbcType=BIGINT},
            plan_com_num    = #{planComNum,jdbcType=BIGINT},
            plan_shop_num   = #{planShopNum,jdbcType=BIGINT},
            plan_house_num  = #{planHouseNum,jdbcType=BIGINT},
            plan_people_num = #{planPeopleNum,jdbcType=BIGINT},
            create_time     = #{createTime,jdbcType=TIMESTAMP},
            create_by       = #{createBy,jdbcType=VARCHAR},
            update_time     = #{updateTime,jdbcType=TIMESTAMP},
            update_by       = #{updateBy,jdbcType=VARCHAR},
            is_valid        = #{isValid,jdbcType=VARCHAR},
            exception_desc  = #{exceptionDesc,jdbcType=VARCHAR},
            visit_type  = #{visitType,jdbcType=VARCHAR}
        where id = #{id,jdbcType=VARCHAR}
    </update>
</mapper>