ShyCommentsMapper.xml 2.79 KB
<?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.cnlive.shenhe.mapper.ShyCommentsMapper">
    <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyComments">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="comment_content" jdbcType="VARCHAR" property="comment_content"/>
        <result column="comment_user_id" jdbcType="INTEGER" property="comment_user_id"/>
        <result column="program_id" jdbcType="VARCHAR" property="program_id"/>
        <result column="activity_id" jdbcType="VARCHAR" property="activity_id"/>
        <result column="platform" jdbcType="VARCHAR" property="platform"/>
        <result column="comment_title" jdbcType="VARCHAR" property="comment_title"/>
        <result column="comment_time" jdbcType="TIMESTAMP" property="comment_time"/>
        <result column="type" jdbcType="VARCHAR" property="type"/>
        <result column="level" jdbcType="INTEGER" property="level"/>
        <result column="spid" jdbcType="INTEGER" property="spid"/>
        <result column="app_id" jdbcType="VARCHAR" property="app_id"/>
        <result column="comment_original_url" jdbcType="VARCHAR" property="comment_original_url"/>
        <result column="shenhe_type" jdbcType="INTEGER" property="shenhe_type"/>
        <result column="updater" jdbcType="VARCHAR" property="updater"/>
        <result column="auditor_id" jdbcType="VARCHAR" property="auditor_id"/>
        <result column="callback" jdbcType="VARCHAR" property="callback"/>
        <result column="is_hot" jdbcType="BIT" property="is_hot"/>
        <result column="msg" jdbcType="VARCHAR" property="msg"/>
        <result column="state" jdbcType="INTEGER" property="state"/>
        <result column="comment_user_name" jdbcType="VARCHAR" property="comment_user_name"/>
        <result column="comment_user_avatar" jdbcType="VARCHAR" property="comment_user_avatar"/>
        <result column="comment_user_ip" jdbcType="CHAR" property="comment_user_ip"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="created_at"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at"/>
        <result column="receive" jdbcType="INTEGER" property="receive"/>
        <result column="receive_user_id" jdbcType="VARCHAR" property="receive_user_id"/>
    </resultMap>

    <select id="selectBySpId" resultType="com.cnlive.shenhe.entity.ShyComments">
        select *
        from shy_comments
        <where>
            <if test="id != null">
                and id = #{id}
            </if>
            <if test="spId != null and spId != 0">
                and spid = #{spId}
            </if>
        </where>
    </select>
</mapper>