<?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.post.PlatPostStationChartMapper">
    
    <resultMap type="PlatPostStationChart" id="PlatPostStationChartResult">
        <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="appMonth"    column="app_month"    />
        <result property="colNum"    column="col_num"    />
        <result property="elevatorNum"    column="elevator_num"    />
        <result property="laNum"    column="la_num"    />
        <result property="seNum"    column="se_num"    />
        <result property="toNum"    column="to_num"    />
        <result property="arNum"    column="ar_num"    />
        <result property="diNum"    column="di_num"    />
        <result property="otNum"    column="ot_num"    />
        <result property="meNum"    column="me_num"    />
        <result property="ofNum"    column="of_num"    />
    </resultMap>

    <sql id="selectPlatPostStationChartVo">
        select id, del_flag, create_by, create_time, update_by, update_time, app_org, app_month, col_num, elevator_num, la_num, se_num, to_num, ar_num, di_num, ot_num, me_num, of_num from large_plat_post_station_chart
    </sql>

    <select id="selectPlatPostStationChartList" parameterType="PlatPostStationChart" resultMap="PlatPostStationChartResult">
        <include refid="selectPlatPostStationChartVo"/>
        <where>  
            <if test="appOrg != null  and appOrg != ''"> and app_org = #{appOrg}</if>
            <if test="appMonth != null "> and app_month = #{appMonth}</if>
            <if test="colNum != null "> and col_num = #{colNum}</if>
            <if test="elevatorNum != null "> and elevator_num = #{elevatorNum}</if>
            <if test="laNum != null "> and la_num = #{laNum}</if>
            <if test="seNum != null "> and se_num = #{seNum}</if>
            <if test="toNum != null "> and to_num = #{toNum}</if>
            <if test="arNum != null "> and ar_num = #{arNum}</if>
            <if test="diNum != null "> and di_num = #{diNum}</if>
            <if test="otNum != null "> and ot_num = #{otNum}</if>
            <if test="meNum != null "> and me_num = #{meNum}</if>
            <if test="ofNum != null "> and of_num = #{ofNum}</if>
        </where>
    </select>
    
    <select id="selectPlatPostStationChartById" parameterType="Long" resultMap="PlatPostStationChartResult">
        <include refid="selectPlatPostStationChartVo"/>
        where id = #{id}
    </select>

    <insert id="insertPlatPostStationChart" parameterType="PlatPostStationChart" useGeneratedKeys="true" keyProperty="id">
        insert into large_plat_post_station_chart
        <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="appMonth != null">app_month,</if>
            <if test="colNum != null">col_num,</if>
            <if test="elevatorNum != null">elevator_num,</if>
            <if test="laNum != null">la_num,</if>
            <if test="seNum != null">se_num,</if>
            <if test="toNum != null">to_num,</if>
            <if test="arNum != null">ar_num,</if>
            <if test="diNum != null">di_num,</if>
            <if test="otNum != null">ot_num,</if>
            <if test="meNum != null">me_num,</if>
            <if test="ofNum != null">of_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="appMonth != null">#{appMonth},</if>
            <if test="colNum != null">#{colNum},</if>
            <if test="elevatorNum != null">#{elevatorNum},</if>
            <if test="laNum != null">#{laNum},</if>
            <if test="seNum != null">#{seNum},</if>
            <if test="toNum != null">#{toNum},</if>
            <if test="arNum != null">#{arNum},</if>
            <if test="diNum != null">#{diNum},</if>
            <if test="otNum != null">#{otNum},</if>
            <if test="meNum != null">#{meNum},</if>
            <if test="ofNum != null">#{ofNum},</if>
         </trim>
    </insert>

    <update id="updatePlatPostStationChart" parameterType="PlatPostStationChart">
        update large_plat_post_station_chart
        <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="appMonth != null">app_month = #{appMonth},</if>
            <if test="colNum != null">col_num = #{colNum},</if>
            <if test="elevatorNum != null">elevator_num = #{elevatorNum},</if>
            <if test="laNum != null">la_num = #{laNum},</if>
            <if test="seNum != null">se_num = #{seNum},</if>
            <if test="toNum != null">to_num = #{toNum},</if>
            <if test="arNum != null">ar_num = #{arNum},</if>
            <if test="diNum != null">di_num = #{diNum},</if>
            <if test="otNum != null">ot_num = #{otNum},</if>
            <if test="meNum != null">me_num = #{meNum},</if>
            <if test="ofNum != null">of_num = #{ofNum},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deletePlatPostStationChartById" parameterType="Long">
        delete from large_plat_post_station_chart where id = #{id}
    </delete>

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