|  | @@ -6,31 +6,32 @@
 | 
	
		
			
				|  |  |  -->
 | 
	
		
			
				|  |  |  <mapper namespace="com.yonge.cooleshow.biz.dal.dao.SysMessageDao">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    <resultMap type="com.yonge.cooleshow.biz.dal.entity.SysMessage" id="message">
 | 
	
		
			
				|  |  | -        <result column="id_" property="id"/>
 | 
	
		
			
				|  |  | -        <result column="title_" property="title"/>
 | 
	
		
			
				|  |  | -        <result column="content_" property="content"/>
 | 
	
		
			
				|  |  | -        <result column="type_" property="type" />
 | 
	
		
			
				|  |  | -        <result column="status_" property="status" />
 | 
	
		
			
				|  |  | -        <result column="receiver_" property="receiver"/>
 | 
	
		
			
				|  |  | -        <result column="send_time_" property="sendTime"/>
 | 
	
		
			
				|  |  | -        <result column="error_msg_" property="errorMsg"/>
 | 
	
		
			
				|  |  | -        <result column="create_on_" property="createOn"/>
 | 
	
		
			
				|  |  | -        <result column="modify_on_" property="modifyOn"/>
 | 
	
		
			
				|  |  | -        <result column="user_id_" property="userId"/>
 | 
	
		
			
				|  |  | -        <result column="message_config_id_" property="messageConfigId"/>
 | 
	
		
			
				|  |  | -        <result column="sub_type_" property="subType"/>
 | 
	
		
			
				|  |  | -        <result column="memo_" property="memo"/>
 | 
	
		
			
				|  |  | -        <result column="read_status_" property="readStatus"/>
 | 
	
		
			
				|  |  | -        <result column="group_" property="group"/>
 | 
	
		
			
				|  |  | -        <result column="client_id_" property="clientId"/>
 | 
	
		
			
				|  |  | -        <result column="img" property="img"/>
 | 
	
		
			
				|  |  | -    </resultMap>
 | 
	
		
			
				|  |  | -    
 | 
	
		
			
				|  |  |      <resultMap type="com.yonge.cooleshow.biz.dal.dto.SysMessageDto" id="messageDto" extends="message">
 | 
	
		
			
				|  |  |          <result column="username_" property="user.username"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  | -    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	<resultMap type="com.yonge.cooleshow.biz.dal.entity.SysMessage" id="message">
 | 
	
		
			
				|  |  | +		<result column="id_" property="id"/>
 | 
	
		
			
				|  |  | +		<result column="title_" property="title"/>
 | 
	
		
			
				|  |  | +		<result column="content_" property="content"/>
 | 
	
		
			
				|  |  | +		<result column="type_" property="type" />
 | 
	
		
			
				|  |  | +		<result column="status_" property="status" />
 | 
	
		
			
				|  |  | +		<result column="receiver_" property="receiver"/>
 | 
	
		
			
				|  |  | +		<result column="send_time_" property="sendTime"/>
 | 
	
		
			
				|  |  | +		<result column="error_msg_" property="errorMsg"/>
 | 
	
		
			
				|  |  | +		<result column="create_on_" property="createOn"/>
 | 
	
		
			
				|  |  | +		<result column="modify_on_" property="modifyOn"/>
 | 
	
		
			
				|  |  | +		<result column="user_id_" property="userId"/>
 | 
	
		
			
				|  |  | +		<result column="message_config_id_" property="messageConfigId"/>
 | 
	
		
			
				|  |  | +		<result column="sub_type_" property="subType"/>
 | 
	
		
			
				|  |  | +		<result column="memo_" property="memo"/>
 | 
	
		
			
				|  |  | +		<result column="read_status_" property="readStatus"/>
 | 
	
		
			
				|  |  | +		<result column="group_" property="group"/>
 | 
	
		
			
				|  |  | +		<result column="client_id_" property="clientId"/>
 | 
	
		
			
				|  |  | +		<result column="img" property="img"/>
 | 
	
		
			
				|  |  | +		<result column="message_type_" property="messageType"/>
 | 
	
		
			
				|  |  | +	</resultMap>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      <resultMap type="com.yonge.cooleshow.biz.dal.dto.Mapper" id="Mapper">
 | 
	
		
			
				|  |  |      	<result column="key_" property="key"/>
 | 
	
		
			
				|  |  |          <result column="value_" property="value"/>
 | 
	
	
		
			
				|  | @@ -169,16 +170,92 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryCount" parameterType="map" resultType="int">
 | 
	
		
			
				|  |  |  		select count(m.id_) from sys_message m
 | 
	
		
			
				|  |  | -		<include refid="queryCondition" />
 | 
	
		
			
				|  |  | -		order by m.create_on_ desc
 | 
	
		
			
				|  |  | +		left join sys_message_config smc on m.message_config_id_ = smc.id_
 | 
	
		
			
				|  |  | +		<where>
 | 
	
		
			
				|  |  | +			m.send_time_ <= now()
 | 
	
		
			
				|  |  | +			<if test="clientId != null and clientId != ''">
 | 
	
		
			
				|  |  | +				and (m.client_id_ = #{clientId} OR m.client_id_ IS NULL)
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="userId != null">
 | 
	
		
			
				|  |  | +				and m.user_id_ = #{userId}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="receiver != null">
 | 
	
		
			
				|  |  | +				and m.receiver_ like '%' #{receiver} '%'
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="status != null">
 | 
	
		
			
				|  |  | +				and m.status_ = #{status,jdbcType=TINYINT}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="readStatus != null">
 | 
	
		
			
				|  |  | +				and m.read_status_ = #{readStatus,jdbcType=TINYINT}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="title != null">
 | 
	
		
			
				|  |  | +				and m.title_ like '%' #{title} '%'
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="type != null">
 | 
	
		
			
				|  |  | +				and m.type_ = #{type}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="group != null">
 | 
	
		
			
				|  |  | +				and m.group_ = #{group}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="readStatus != null">
 | 
	
		
			
				|  |  | +				and m.read_status_ = #{readStatus}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="messageType != null and messageType.trim() != ''">
 | 
	
		
			
				|  |  | +				and find_in_set(smc.message_type_, #{messageType})
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="startTime != null">
 | 
	
		
			
				|  |  | +				and m.send_time_ >= #{startTime}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="endTime != null">
 | 
	
		
			
				|  |  | +				and #{endTime} >= m.send_time_
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +		</where>
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<select id="queryPage" parameterType="map" resultMap="message">
 | 
	
		
			
				|  |  |  		select m.*,
 | 
	
		
			
				|  |  | -		smc.sub_type_,smc.icon_ img
 | 
	
		
			
				|  |  | +		smc.sub_type_, smc.message_type_
 | 
	
		
			
				|  |  |  		from sys_message m
 | 
	
		
			
				|  |  |  		left join sys_message_config smc on m.message_config_id_ = smc.id_
 | 
	
		
			
				|  |  | -		<include refid="queryCondition" />
 | 
	
		
			
				|  |  | +		<where>
 | 
	
		
			
				|  |  | +			m.send_time_ <= now()
 | 
	
		
			
				|  |  | +			<if test="clientId != null and clientId != ''">
 | 
	
		
			
				|  |  | +				and (m.client_id_ = #{clientId} OR m.client_id_ IS NULL)
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="userId != null">
 | 
	
		
			
				|  |  | +				and m.user_id_ = #{userId}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="receiver != null">
 | 
	
		
			
				|  |  | +				and m.receiver_ like '%' #{receiver} '%'
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="status != null">
 | 
	
		
			
				|  |  | +				and m.status_ = #{status,jdbcType=TINYINT}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="readStatus != null">
 | 
	
		
			
				|  |  | +				and m.read_status_ = #{readStatus,jdbcType=TINYINT}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="title != null">
 | 
	
		
			
				|  |  | +				and m.title_ like '%' #{title} '%'
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="type != null">
 | 
	
		
			
				|  |  | +				and m.type_ = #{type}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="group != null">
 | 
	
		
			
				|  |  | +				and m.group_ = #{group}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="readStatus != null">
 | 
	
		
			
				|  |  | +				and m.read_status_ = #{readStatus}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="messageType != null and messageType.trim() != ''">
 | 
	
		
			
				|  |  | +				and find_in_set(smc.message_type_, #{messageType})
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="startTime != null">
 | 
	
		
			
				|  |  | +				and m.send_time_ >= #{startTime}
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +			<if test="endTime != null">
 | 
	
		
			
				|  |  | +				and #{endTime} >= m.send_time_
 | 
	
		
			
				|  |  | +			</if>
 | 
	
		
			
				|  |  | +		</where>
 | 
	
		
			
				|  |  |  		order by m.create_on_ desc
 | 
	
		
			
				|  |  |  		<include refid="global.limit" />
 | 
	
		
			
				|  |  |  	</select>
 |