<?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.stylefeng.guns.modular.system.dao.TNoticesMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TNotices">
|
<id column="id" property="id"/>
|
<result column="title" property="title"/>
|
<result column="content" property="content"/>
|
<result column="sort" property="sort"/>
|
<result column="isShow" property="isShow"/>
|
<result column="isBroadcast" property="isBroadcast"/>
|
<result column="type" property="type"/>
|
<result column="imgUrl" property="imgUrl"/>
|
<result column="isDelete" property="isDelete"/>
|
<result column="isUser" property="isUser"/>
|
<result column="isDriver" property="isDriver"/>
|
|
<result column="flag" property="flag"/>
|
<result column="insertTime" property="insertTime"/>
|
<result column="insertUser" property="insertUser"/>
|
<result column="updateTime" property="updateTime"/>
|
<result column="updateUser" property="updateUser"/>
|
</resultMap>
|
|
|
<select id="queryNotices" resultType="com.stylefeng.guns.modular.system.model.TNotices">
|
select
|
id as id,
|
title as title,
|
content as content,
|
sort as sort,
|
isShow as isShow,
|
isBroadcast as isBroadcast,
|
`type` as `type`,
|
imgUrl as imgUrl,
|
flag as flag,
|
insertTime as insertTime,
|
insertUser as insertUser,
|
updateTime as updateTime,
|
updateUser as updateUser
|
from t_notices where flag != 3 and isDelete = 1 and `type` = #{type}
|
<if test="type == 2">
|
and isBroadcast = 1
|
</if>
|
<if test="type == 1">
|
and isShow = 1
|
</if>
|
</select>
|
|
|
<select id="queryList" resultType="map">
|
select
|
b.id as id,
|
a.title as title,
|
a.content as content,
|
(1) as `type`,
|
a.imgUrl as img,
|
DATE_FORMAT(b.insertTime, '%Y-%m-%d %H:%i') as `time`,
|
b.`read` as `read`
|
from t_notices a
|
left join t_system_notice b on (a.id = b.noticesId)
|
where a.`type` = 2 and a.flag != 3 and a.isShow = 1 and b.type = 1 and b.userType = 1
|
and b.userId = #{uid} order by b.insertTime desc limit #{pageNum}, #{size}
|
</select>
|
</mapper>
|