| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <?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.ProjectDeclarationDao">
- <select id="findPageInfo" resultType="platform.modules.government.entity.ProjectDeclaration">
- SELECT * FROM project_declaration
- where 1=1
- <if test="projectName != null and projectName != '' ">
- and project_name LIKE CONCAT ('%',#{projectName},'%')
- </if>
- <if test="startTime1 != null and startTime1 != '' ">
- and apply_startDate <![CDATA[>=]]> #{startTime1}
- </if>
- <if test="startTime2 != null and startTime2 != '' ">
- and apply_startDate <![CDATA[<=]]> #{startTime2}
- </if>
- <if test="endTime1 != null and endTime1 != '' ">
- and apply_endDate <![CDATA[>=]]> #{endTime1}
- </if>
- <if test="endTime2 != null and endTime2 != '' ">
- and apply_endDate <![CDATA[<=]]> #{endTime2}
- </if>
- order by create_time desc
- </select>
- <select id="selectById" resultType="platform.modules.government.entity.ProjectDeclaration">
- select * from project_declaration where id = #{id}
- </select>
- <select id="findByCondition" resultType="platform.modules.government.entity.ProjectDeclaration">
- SELECT distinct
- p.* FROM
- project_declaration p
- LEFT JOIN notices_accept n on n.recorde_id = p.id
- where 1=1
- <if test="projectName != null and projectName != '' ">
- and p.project_name LIKE CONCAT ('%',#{projectName},'%')
- </if>
- <if test="startTime1 != null and startTime1 != '' ">
- and p.apply_startDate <![CDATA[>=]]> left(#{startTime1},10)
- </if>
- <if test="startTime2 != null and startTime2 != '' ">
- and p.apply_startDate <![CDATA[<=]]> left(#{startTime2},10)
- </if>
- <if test="endTime1 != null and endTime1 != '' ">
- and p.apply_endDate <![CDATA[>=]]> left(#{endTime1},10)
- </if>
- <if test="endTime2 != null and endTime2 != '' ">
- and p.apply_endDate <![CDATA[<=]]> left(#{endTime2},10)
- </if>
- <if test="request.company_id != null and request.company_id != '' ">
- and n.user_id = #{request.company_id}
- </if>
- <if test="request.isActive != null and request.isActive != '' ">
- and p.apply_startDate <![CDATA[<=]]> left(now(),10)
- and p.apply_endDate <![CDATA[>=]]> left(now(),10)
- and p.status != 0
- </if>
- <if test="searchCondition.is_online_application != null ">
- and p.is_online_application =#{searchCondition.is_online_application}
- </if>
- order by p.create_time desc
- </select>
- <select id="findUnionProjectsOnHome" resultType="platform.modules.government.entity.ProjectDeclaration">
- <if test="request.type != null and request.type != '' and request.type =='4'.toString()">
- select * from
- (
- SELECT
- a.id,a.project_name,a.create_time,a.project_source,a.apply_enddate,0 as isFilling,a.project_content AS
- content
- FROM project_declaration a
- where
- a.del_flag=0
- and a.is_open = 1
- and a.status = 1
- UNION
- select
- b.id ,b.project_name,b.create_time,b.project_source,b.end_time AS apply_enddate,3 as isFilling,b.content
- from project_intelligent_declaration b
- where b.del_flag = 0 and b.status=1
- ) temp
- order by temp.create_time desc
- </if>
- <if test="request.type != null and request.type != '' and request.type !='4'.toString()">
- select
- b.id ,b.project_name,b.create_time,b.project_source,b.end_time AS apply_enddate,1 as isFilling,b.content
- from project_provinces_declaration b
- where b.del_flag = 0 and b.status=1 AND b.project_source = #{request.type} AND b.is_public = 1
- order by b.create_time desc
- </if>
- <if test="request.type ==''">
- select * from
- (
- SELECT
- a.id,a.project_name,a.create_time,a.project_source,a.apply_enddate,0 as isFilling,a.project_content AS
- content
- FROM project_declaration a
- where
- a.del_flag=0
- and a.is_open = 1
- and a.status = 1
- UNION
- select
- b.id ,b.project_name,b.create_time,b.project_source,b.end_time AS apply_enddate,1 as isFilling,b.content
- from project_provinces_declaration b
- where b.del_flag = 0 and b.status=1 AND b.is_public = 1
- UNION
- select
- b.id ,b.project_name,b.create_time,b.project_source,b.end_time AS apply_enddate,3 as isFilling,b.content
- from project_intelligent_declaration b
- where b.del_flag = 0 and b.status=1
- ) temp
- where 1=1
- <if test="request.startTime !='' and request.startTime !=null ">
- and temp.create_time <![CDATA[>=]]> #{request.startTime}
- </if>
- <if test="request.endTime !='' and request.endTime !=null ">
- and temp.create_time <![CDATA[<=]]> #{request.endTime}
- </if>
- order by temp.create_time desc
- </if>
- </select>
- <select id="findUnionProjectsOnHomeV2" resultType="platform.modules.government.entity.ProjectDeclaration">
- select * from
- (
- SELECT
- a.id,a.project_name,a.create_time,a.project_source,a.apply_enddate,0 as isFilling,a.project_content AS
- content
- FROM project_declaration a
- where
- a.del_flag=0
- and a.is_open = 1
- and a.status = 1
- UNION
- select
- b.id ,b.project_name,b.create_time,b.project_source,b.end_time AS apply_enddate,3 as isFilling,b.content
- from project_intelligent_declaration b
- where b.del_flag = 0 and b.status=1
- union
- select
- c.id ,c.project_name,c.create_time,c.project_source,c.end_time AS apply_enddate,1 as isFilling,c.content
- from project_provinces_declaration c
- where c.del_flag = 0 and c.status=1
- AND c.is_public = 1
- ) temp
- where 1=1
- <if test="request.type != null and request.type != ''">
- and temp.project_source = #{request.type}
- </if>
- <if test="request.startTime !='' and request.startTime !=null ">
- and temp.create_time <![CDATA[>=]]> #{request.startTime}
- </if>
- <if test="request.endTime !='' and request.endTime !=null ">
- and temp.create_time <![CDATA[<=]]> #{request.endTime}
- </if>
- order by temp.create_time desc
- </select>
- <select id="findProjectsOnHome" resultType="platform.modules.government.entity.ProjectDeclaration">
- SELECT
- a.project_name,a.id,a.create_time,a.project_source,a.apply_enddate
- FROM project_declaration a
- where
- a.del_flag=0
- and a.is_open = 1
- and a.status = 1
- <if test="request.keyword!=null and request.keyword!=''">
- and a.project_name LIKE CONCAT ('%',#{ request.keyword},'%')
- </if>
- <if test="request.type!=null and request.type!=''">
- and a.project_source = #{ request.type}
- </if>
- order by a.create_time desc
- limit #{request.start},#{request.page_size}
- </select>
- <select id="findProjectsCountOnHome" resultType="integer">
- SELECT
- count(0)
- FROM project_declaration a
- where a.del_flag = 0
- and a.is_open = 1
- and a.status = 1
- <if test="request.keyword!=null and request.keyword!=''">
- and a.project_name LIKE CONCAT ('%',#{ request.keyword},'%')
- </if>
- <if test="request.type!=null and request.type!=''">
- and a.project_source = #{ request.type}
- </if>
- </select>
- </mapper>
|