<?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.project.zcustom.mapper.basics.PlatBasicsSystemMapper">
    
    <resultMap type="PlatBasicsSystem" id="PlatBasicsSystemResult">
        <result property="id"    column="id"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="appOrg"    column="app_org"    />
        <result property="sysType"    column="sys_type"    />
        <result property="between6Num"    column="between6_num"    />
        <result property="between12Num"    column="between12_num"    />
        <result property="between18Num"    column="between18_num"    />
        <result property="between24Num"    column="between24_num"    />
    </resultMap>

    <sql id="selectPlatBasicsSystemVo">
        select id, del_flag, create_by, create_time, update_by, update_time, app_org, sys_type, between6_num, between12_num, between18_num, between24_num from large_plat_basics_system
    </sql>

    <select id="selectPlatBasicsSystemList" parameterType="PlatBasicsSystem" resultMap="PlatBasicsSystemResult">
        <include refid="selectPlatBasicsSystemVo"/>
        <where>  
            <if test="appOrg != null  and appOrg != ''"> and app_org = #{appOrg}</if>
            <if test="sysType != null "> and sys_type = #{sysType}</if>
            <if test="between6Num != null "> and between6_num = #{between6Num}</if>
            <if test="between12Num != null "> and between12_num = #{between12Num}</if>
            <if test="between18Num != null "> and between18_num = #{between18Num}</if>
            <if test="between24Num != null "> and between24_num = #{between24Num}</if>
        </where>
    </select>
    
    <select id="selectPlatBasicsSystemById" parameterType="Long" resultMap="PlatBasicsSystemResult">
        <include refid="selectPlatBasicsSystemVo"/>
        where id = #{id}
    </select>

    <insert id="insertPlatBasicsSystem" parameterType="PlatBasicsSystem" useGeneratedKeys="true" keyProperty="id">
        insert into large_plat_basics_system
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="appOrg != null">app_org,</if>
            <if test="sysType != null">sys_type,</if>
            <if test="between6Num != null">between6_num,</if>
            <if test="between12Num != null">between12_num,</if>
            <if test="between18Num != null">between18_num,</if>
            <if test="between24Num != null">between24_num,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="appOrg != null">#{appOrg},</if>
            <if test="sysType != null">#{sysType},</if>
            <if test="between6Num != null">#{between6Num},</if>
            <if test="between12Num != null">#{between12Num},</if>
            <if test="between18Num != null">#{between18Num},</if>
            <if test="between24Num != null">#{between24Num},</if>
         </trim>
    </insert>

    <update id="updatePlatBasicsSystem" parameterType="PlatBasicsSystem">
        update large_plat_basics_system
        <trim prefix="SET" suffixOverrides=",">
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="appOrg != null">app_org = #{appOrg},</if>
            <if test="sysType != null">sys_type = #{sysType},</if>
            <if test="between6Num != null">between6_num = #{between6Num},</if>
            <if test="between12Num != null">between12_num = #{between12Num},</if>
            <if test="between18Num != null">between18_num = #{between18Num},</if>
            <if test="between24Num != null">between24_num = #{between24Num},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deletePlatBasicsSystemById" parameterType="Long">
        delete from large_plat_basics_system where id = #{id}
    </delete>

    <delete id="deletePlatBasicsSystemByIds" parameterType="String">
        delete from large_plat_basics_system where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <delete id="reallyDeleteByWrapper">
        DELETE FROM large_plat_basics_system ${ew.customSqlSegment}
    </delete>
</mapper>