UserNoticeMapper.xml 2.18 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.bjivt.entity.showtime.UserNoticeMapper">
	
	<resultMap id="BaseResultMap" type="java.lang.String" >
	    <result column="id" property="id" />
	</resultMap>
	<resultMap id="AnchorResultMap" type="java.lang.String" >
	    <result column="user_id" property="id" />
	</resultMap>

	<sql id="Base_Column_List">
		user_id
	</sql>
	
	<select id="loadAllUserList" parameterType="java.util.HashMap" resultMap="BaseResultMap">  
		<![CDATA[
			SELECT id FROM tbl_user_list where  is_robot<>1 and active='Y' 
		]]>
	    <if test="page != null and page !=''">
	    <if test="page.from != null and page.size != null">
          limit #{page.from},#{page.size}
   		</if>
   		</if>
	</select>
	
	<select id="loadAnchorUserList" parameterType="java.util.HashMap" resultMap="AnchorResultMap">  
		<![CDATA[
			SELECT user_id 	FROM tbl_live_list 
		]]>
	    <if test="page != null and page !=''">
	    <if test="page.from != null and page.size != null">
          limit #{page.from},#{page.size}
   		</if>
   		</if>
	</select>
	
	<select id="loadCommonUserList" parameterType="java.util.HashMap" resultMap="BaseResultMap">  
		<![CDATA[
			select id from tbl_user_list where id not in (select user_id from tbl_live_list )  and is_robot<>1 and active='Y'
		]]>
	    <if test="page != null and page !=''">
	    <if test="page.from != null and page.size != null">
          limit #{page.from},#{page.size}
   		</if>
   		</if>
	</select>
  <select id="loadAllUserCount" resultType="java.lang.Integer" parameterType="java.util.HashMap">
  	<![CDATA[
   		 SELECT count(id) FROM tbl_user_list where  is_robot<>1 and active='Y'
    ]]>
 	</select>
  <select id="loadAnchorUserCount" resultType="java.lang.Integer" parameterType="java.util.HashMap">
    SELECT count(id)
			FROM
				tbl_live_list
 	</select>
  <select id="loadCommonUserCount" resultType="java.lang.Integer" parameterType="java.util.HashMap">
  <![CDATA[
    	select count(id) from tbl_user_list where id not in (select user_id from tbl_live_list ) and is_robot<>1 and active='Y'
    	]]>
 	</select>
</mapper>