61 lines
2.0 KiB
XML
61 lines
2.0 KiB
XML
<?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.haitongauto.mapper.admin.AnnouncementAdminMapper">
|
|
<!--获取发布人员(作者)去重列表-->
|
|
<select id="getAuthorList" resultType="String">
|
|
select
|
|
distinct author
|
|
from applet_announcement
|
|
where is_del=0
|
|
</select>
|
|
|
|
<!--根据特定条件查询历史公告:(tilKeywords, dateStart,dateEnd,sort,author);-->
|
|
<select id="AnnouncementListForCondition" resultType="com.haitongauto.models.pojo.Announcement">
|
|
select
|
|
id,
|
|
title,
|
|
abstracts,
|
|
sort,
|
|
announcement,
|
|
announcement_text,
|
|
author,
|
|
reading_volume,
|
|
create_time,
|
|
update_time,
|
|
is_del
|
|
from applet_announcement
|
|
where is_del=0
|
|
<if test="tilKeywords!=null and tilKeywords != ''">
|
|
and title like concat('%',#{tilKeywords},'%')
|
|
</if>
|
|
<if test="dateStart!=null and dateStart!=null">
|
|
and to_char(update_time,'yyyy-mm-dd')>=#{dateStart}
|
|
</if>
|
|
<if test="dateEnd!=null and dateEnd!=null">
|
|
and to_char(update_time,'yyyy-mm-dd')<=#{dateEnd}
|
|
</if>
|
|
<if test="sort!=null">
|
|
and sort =#{sort}
|
|
</if>
|
|
<if test="list!=null">
|
|
and author in
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<!--根据特定条件查询历史公告:(tilKeywords, dateStart,dateEnd,sort,author);-->
|
|
<select id="AnnouncementListForWeek" resultType="com.haitongauto.models.pojo.Announcement">
|
|
select
|
|
*
|
|
from applet_announcement
|
|
where is_del=0
|
|
and create_time >= now() - interval '1 week'
|
|
order by create_time desc
|
|
</select>
|
|
|
|
</mapper> |