| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?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="platform.modules.government.dao.ContentDao">
- <select id="findContents" resultType="platform.modules.government.entity.Content">
- SELECT
- a.title,a.brief,a.id,a.create_time
- FROM z_content a
- where a.navigation_id =#{request.id} and a.del_flag=0
- and a.is_start=1
- <if test="request.keyword!=null and request.keyword!=''">
- and (a.title LIKE CONCAT ('%',#{ request.keyword},'%')
- or a.brief LIKE CONCAT ('%',#{ request.keyword},'%') )
- </if>
- order by a.is_top desc,a.sort asc, a.create_time desc
- limit #{request.start},#{request.page_size}
- </select>
- <select id="findContentsCount" resultType="integer">
- SELECT
- count(0)
- FROM z_content a
- where a.navigation_id =#{request.id}
- and a.del_flag=0
- and a.is_start=1
- <if test="request.keyword!=null and request.keyword!=''">
- and (a.title LIKE CONCAT ('%',#{ request.keyword},'%')
- or a.brief LIKE CONCAT ('%',#{ request.keyword},'%') )
- </if>
- </select>
- <select id="findContentsByNavigationId" resultType="platform.modules.government.entity.Content">
- SELECT
- a.id,a.title
- FROM z_content a
- where a.navigation_id =2
- and a.del_flag=0
- and a.is_start=1
- order by a.is_top desc,a.sort asc, a.create_time desc
- </select>
- <select id="countContent" resultType="integer">
- SELECT
- count(0)
- FROM z_content a
- where a.navigation_id =1
- and a.del_flag=0
- and a.is_start=1
- </select>
- <select id="findContentsByNavigationIdForIndex" resultType="platform.modules.government.entity.Content">
- SELECT
- a.id,
- a.title,
- a.create_time publish_time
- FROM
- z_content a
- WHERE
- a.navigation_id = #{id}
- AND a.del_flag = 0
- AND a.is_start = 1
- ORDER BY
- a.is_top DESC,
- a.sort ASC,
- a.create_time DESC
- LIMIT 5
- </select>
- <select id="findContentList" resultType="platform.modules.government.entity.Content">
- SELECT
- a.title,a.brief,a.id,a.create_time,a.content
- FROM z_content a
- where a.navigation_id =#{request.id} and a.del_flag=0
- and a.is_start=1
- <if test="request.keyword!=null and request.keyword!=''">
- and (a.title LIKE CONCAT ('%',#{ request.keyword},'%')
- or a.brief LIKE CONCAT ('%',#{ request.keyword},'%') )
- </if>
- order by a.is_top desc,a.sort asc, a.create_time desc
- </select>
- <select id="searchGlobal" resultType="platform.modules.home.dto.SearchGlobalDto">
- SELECT
- id,
- title,
- content,
- type,
- create_time
- FROM
- (
- SELECT
- content.id id,
- content.title title,
- content.content content,
- "content" type,
- content.create_time create_time
- FROM
- z_content content
- WHERE
- content.del_flag = 0 UNION ALL
- SELECT
- activity.id id,
- activity.activity_title title,
- activity.content content,
- "activity" type,
- activity.create_time create_time
- FROM
- ac_activity_detail activity
- WHERE
- activity.del_flag = 0
- ) temp
- WHERE
- 1 = 1
- <if test="keyword != null and keyword != ''">
- AND ( title LIKE CONCAT ( '%', #{keyword}, '%' ) OR content LIKE CONCAT ( '%', #{keyword}, '%' ) )
- </if>
- ORDER BY
- create_time DESC
- </select>
- </mapper>
|