<?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.smart.PlatGreenSmartOtherMapper">
    
    <resultMap type="PlatGreenSmartOther" id="PlatGreenSmartOtherResult">
        <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="participateNum"    column="participate_num"    />
        <result property="completedNum"    column="completed_num"    />
        <result property="actualDiningNum"    column="actual_dining_num"    />
        <result property="lunchNum"    column="lunch_num"    />
        <result property="dinnerNum"    column="dinner_num"    />
        <result property="morningNum"    column="morning_num"    />
        <result property="noonNum"    column="noon_num"    />
        <result property="nightNum"    column="night_num"    />
        <result property="dailyMenuNum"    column="daily_menu_num"    />
        <result property="weeklyCuisineNum"    column="weekly_cuisine_num"    />
        <result property="foodVotingNum"    column="food_voting_num"    />
        <result property="clearPlateNum"    column="clear_plate_num"    />
        <result property="culinaryExchangeNum"    column="culinary_exchange_num"    />
        <result property="takeOutFoodNum"    column="take_out_food_num"    />
        <result property="selfFoodNum"    column="self_food_num"    />
        <result property="holidaySpecialNum"    column="holiday_special_num"    />
        <result property="breakServiceNum"    column="break_service_num"    />
        <result property="laundryServiceNum"    column="laundry_service_num"    />
        <result property="barberServiceNum"    column="barber_service_num"    />
    </resultMap>

    <sql id="selectPlatGreenSmartOtherVo">
        select id, del_flag, create_by, create_time, update_by, update_time, app_org, participate_num, completed_num, actual_dining_num, lunch_num, dinner_num, morning_num, noon_num, night_num, daily_menu_num, weekly_cuisine_num, food_voting_num, clear_plate_num, culinary_exchange_num, take_out_food_num, self_food_num, holiday_special_num, break_service_num, laundry_service_num, barber_service_num from large_plat_green_smart_other
    </sql>

    <select id="selectPlatGreenSmartOtherList" parameterType="PlatGreenSmartOther" resultMap="PlatGreenSmartOtherResult">
        <include refid="selectPlatGreenSmartOtherVo"/>
        <where>  
            <if test="appOrg != null  and appOrg != ''"> and app_org = #{appOrg}</if>
            <if test="participateNum != null "> and participate_num = #{participateNum}</if>
            <if test="completedNum != null "> and completed_num = #{completedNum}</if>
            <if test="actualDiningNum != null "> and actual_dining_num = #{actualDiningNum}</if>
            <if test="lunchNum != null "> and lunch_num = #{lunchNum}</if>
            <if test="dinnerNum != null "> and dinner_num = #{dinnerNum}</if>
            <if test="morningNum != null "> and morning_num = #{morningNum}</if>
            <if test="noonNum != null "> and noon_num = #{noonNum}</if>
            <if test="nightNum != null "> and night_num = #{nightNum}</if>
            <if test="dailyMenuNum != null "> and daily_menu_num = #{dailyMenuNum}</if>
            <if test="weeklyCuisineNum != null "> and weekly_cuisine_num = #{weeklyCuisineNum}</if>
            <if test="foodVotingNum != null "> and food_voting_num = #{foodVotingNum}</if>
            <if test="clearPlateNum != null "> and clear_plate_num = #{clearPlateNum}</if>
            <if test="culinaryExchangeNum != null "> and culinary_exchange_num = #{culinaryExchangeNum}</if>
            <if test="takeOutFoodNum != null "> and take_out_food_num = #{takeOutFoodNum}</if>
            <if test="selfFoodNum != null "> and self_food_num = #{selfFoodNum}</if>
            <if test="holidaySpecialNum != null "> and holiday_special_num = #{holidaySpecialNum}</if>
            <if test="breakServiceNum != null "> and break_service_num = #{breakServiceNum}</if>
            <if test="laundryServiceNum != null "> and laundry_service_num = #{laundryServiceNum}</if>
            <if test="barberServiceNum != null "> and barber_service_num = #{barberServiceNum}</if>
        </where>
    </select>
    
    <select id="selectPlatGreenSmartOtherById" parameterType="Long" resultMap="PlatGreenSmartOtherResult">
        <include refid="selectPlatGreenSmartOtherVo"/>
        where id = #{id}
    </select>

    <insert id="insertPlatGreenSmartOther" parameterType="PlatGreenSmartOther" useGeneratedKeys="true" keyProperty="id">
        insert into large_plat_green_smart_other
        <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="participateNum != null">participate_num,</if>
            <if test="completedNum != null">completed_num,</if>
            <if test="actualDiningNum != null">actual_dining_num,</if>
            <if test="lunchNum != null">lunch_num,</if>
            <if test="dinnerNum != null">dinner_num,</if>
            <if test="morningNum != null">morning_num,</if>
            <if test="noonNum != null">noon_num,</if>
            <if test="nightNum != null">night_num,</if>
            <if test="dailyMenuNum != null">daily_menu_num,</if>
            <if test="weeklyCuisineNum != null">weekly_cuisine_num,</if>
            <if test="foodVotingNum != null">food_voting_num,</if>
            <if test="clearPlateNum != null">clear_plate_num,</if>
            <if test="culinaryExchangeNum != null">culinary_exchange_num,</if>
            <if test="takeOutFoodNum != null">take_out_food_num,</if>
            <if test="selfFoodNum != null">self_food_num,</if>
            <if test="holidaySpecialNum != null">holiday_special_num,</if>
            <if test="breakServiceNum != null">break_service_num,</if>
            <if test="laundryServiceNum != null">laundry_service_num,</if>
            <if test="barberServiceNum != null">barber_service_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="participateNum != null">#{participateNum},</if>
            <if test="completedNum != null">#{completedNum},</if>
            <if test="actualDiningNum != null">#{actualDiningNum},</if>
            <if test="lunchNum != null">#{lunchNum},</if>
            <if test="dinnerNum != null">#{dinnerNum},</if>
            <if test="morningNum != null">#{morningNum},</if>
            <if test="noonNum != null">#{noonNum},</if>
            <if test="nightNum != null">#{nightNum},</if>
            <if test="dailyMenuNum != null">#{dailyMenuNum},</if>
            <if test="weeklyCuisineNum != null">#{weeklyCuisineNum},</if>
            <if test="foodVotingNum != null">#{foodVotingNum},</if>
            <if test="clearPlateNum != null">#{clearPlateNum},</if>
            <if test="culinaryExchangeNum != null">#{culinaryExchangeNum},</if>
            <if test="takeOutFoodNum != null">#{takeOutFoodNum},</if>
            <if test="selfFoodNum != null">#{selfFoodNum},</if>
            <if test="holidaySpecialNum != null">#{holidaySpecialNum},</if>
            <if test="breakServiceNum != null">#{breakServiceNum},</if>
            <if test="laundryServiceNum != null">#{laundryServiceNum},</if>
            <if test="barberServiceNum != null">#{barberServiceNum},</if>
         </trim>
    </insert>

    <update id="updatePlatGreenSmartOther" parameterType="PlatGreenSmartOther">
        update large_plat_green_smart_other
        <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="participateNum != null">participate_num = #{participateNum},</if>
            <if test="completedNum != null">completed_num = #{completedNum},</if>
            <if test="actualDiningNum != null">actual_dining_num = #{actualDiningNum},</if>
            <if test="lunchNum != null">lunch_num = #{lunchNum},</if>
            <if test="dinnerNum != null">dinner_num = #{dinnerNum},</if>
            <if test="morningNum != null">morning_num = #{morningNum},</if>
            <if test="noonNum != null">noon_num = #{noonNum},</if>
            <if test="nightNum != null">night_num = #{nightNum},</if>
            <if test="dailyMenuNum != null">daily_menu_num = #{dailyMenuNum},</if>
            <if test="weeklyCuisineNum != null">weekly_cuisine_num = #{weeklyCuisineNum},</if>
            <if test="foodVotingNum != null">food_voting_num = #{foodVotingNum},</if>
            <if test="clearPlateNum != null">clear_plate_num = #{clearPlateNum},</if>
            <if test="culinaryExchangeNum != null">culinary_exchange_num = #{culinaryExchangeNum},</if>
            <if test="takeOutFoodNum != null">take_out_food_num = #{takeOutFoodNum},</if>
            <if test="selfFoodNum != null">self_food_num = #{selfFoodNum},</if>
            <if test="holidaySpecialNum != null">holiday_special_num = #{holidaySpecialNum},</if>
            <if test="breakServiceNum != null">break_service_num = #{breakServiceNum},</if>
            <if test="laundryServiceNum != null">laundry_service_num = #{laundryServiceNum},</if>
            <if test="barberServiceNum != null">barber_service_num = #{barberServiceNum},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deletePlatGreenSmartOtherById" parameterType="Long">
        delete from large_plat_green_smart_other where id = #{id}
    </delete>

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