<?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.yonge.cooleshow.bbs.dao.BbsConfigLabelDao">
    <resultMap id="BaseResultMap" type="com.yonge.cooleshow.bbs.entity.BbsConfigLabel">
        <result column="id_" property="id"/>
        <result column="label_name_" property="labelName"/>
        <result column="create_by_" property="createBy"/>
        <result column="update_by_" property="updateBy"/>
        <result column="created_time_" property="createdTime"/>
        <result column="updated_time_" property="updatedTime"/>
        <result column="del_flag_" property="delFlag"/>
    </resultMap>

    <!-- 表字段 -->
    <sql id="baseColumns">
         t.id_ as id
        , t.label_name_ as labelName
        , t.create_by_ as createBy
        , t.update_by_ as updateBy
        , t.created_time_ as createdTime
        , t.updated_time_ as updatedTime
        , t.del_flag_ as delFlag
    </sql>

    <select id="detail" resultType="com.yonge.cooleshow.bbs.vo.BbsConfigLabelVo">
        SELECT
        <include refid="baseColumns"/>
        FROM bbs_config_label t
        where t.id_ = #{id}
    </select>
    <select id="selectPage" resultType="com.yonge.cooleshow.bbs.vo.BbsConfigLabelVo">
        SELECT
        <include refid="baseColumns"/>
        FROM bbs_config_label t
        <where>
            <if test="param.delFlag != null">
                t.del_flag_ = #{param.delFlag}
            </if>
        </where>
    </select>
    <select id="selectAll" resultType="com.yonge.cooleshow.bbs.entity.BbsConfigLabel">
        SELECT
        <include refid="baseColumns"/>
        FROM bbs_config_label t
        <where>
            <if test="_parameter != null">
                AND t.del_flag_ = #{delFlag}
            </if>
        </where>
    </select>
    <update id="updateFlagByIds">
        UPDATE bbs_config_label
        SET del_flag_ = 1
        WHERE id_ IN
        <foreach collection="param.ids" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
</mapper>