| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <?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.company.dao.ProjectFillingDao">
- <!-- 企业我的项目填报列表 -->
- <select id="findByCondition" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT DISTINCT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.receive_date,
- a.declaration_id,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by,
- d.project_source as project_source,
- c.company_name as company_name
- FROM
- project_filling a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN project_filling_declaration d on d.id = a.declaration_id
- WHERE
- a.del_flag = '0'
- <if test="searchCondition.company_id!=null and searchCondition.company_id!=''">
- and a.company_id = #{searchCondition.company_id}
- </if>
- <if test="searchCondition.project_name!=null and searchCondition.project_name!=''">
- and d.project_name like CONCAT ('%',#{searchCondition.project_name},'%')
- </if>
- <if test="searchCondition.apply_status!=null and searchCondition.apply_status!=''">
- and a.apply_status = #{searchCondition.apply_status}
- </if>
- <if test="searchCondition.approve_status!=null and searchCondition.approve_status!=''">
- and a.approve_status=#{searchCondition.approve_status}
- </if>
- <if test="searchCondition.startTime!=null and searchCondition.startTime!=''">
- and a.apply_date >= #{searchCondition.startTime}
- </if>
- <if test="searchCondition.endTime!=null and searchCondition.endTime!=''">
- and a.apply_date <= #{searchCondition.endTime}
- </if>
- order by create_time desc
- </select>
- <select id="findApplyById" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT DISTINCT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.receive_date,
- a.declaration_id,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by,
- s.service_super_type as service_super_type,
- s.id as service_type,
- s.service_type_name as service_type_name,
- d.project_source as project_source,
- c.company_name as company_name
- FROM
- project_filling a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN project_filling_declaration d on d.id = a.declaration_id
- LEFT JOIN project_service_type s on s.id = d.project_service_type
- WHERE
- a.del_flag = '0' and a.id = #{apply_id}
- </select>
- <select id="findExistFilling" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT
- a.id,
- a.company_id,
- a.declaration_id
- FROM
- project_filling a
- WHERE a.del_flag = '0'
- <if test="searchCondition.company_id!=null and searchCondition.company_id!=''">
- and a.company_id=#{searchCondition.company_id}
- </if>
- <if test="searchCondition.declaration_id!=null and searchCondition.declaration_id!=''">
- and a.declaration_id=#{searchCondition.declaration_id}
- </if>
- </select>
- <!-- 企业我的项目填报列表 -->
- <select id="findPageById" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT DISTINCT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.receive_date,
- a.declaration_id,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by,
- s.service_super_type as service_super_type,
- s.id as service_type,
- s.service_type_name as service_type_name,
- d.project_source as project_source,
- c.company_name as company_name
- FROM
- project_filling a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN project_filling_declaration d on d.id = a.declaration_id
- LEFT JOIN project_service_type s on s.id = d.project_service_type
- WHERE
- a.del_flag = '0'
- and d.id = #{id}
- and a.apply_status != '0'
- order by create_time desc
- </select>
- <!-- 企业我的项目填报列表 -->
- <select id="findPageByIdAndApproveStatus" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT DISTINCT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.receive_date,
- a.declaration_id,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by,
- s.service_super_type as service_super_type,
- s.id as service_type,
- s.service_type_name as service_type_name,
- d.project_source as project_source,
- c.company_name as company_name
- FROM
- project_filling a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN project_filling_declaration d on d.id = a.declaration_id
- LEFT JOIN project_service_type s on s.id = d.project_service_type
- WHERE
- a.del_flag = '0'
- and d.id = #{id}
- <if test="approveStatus!=null and approveStatus!=''">
- and a.approve_status = #{approveStatus}
- </if>
- and a.apply_status != '0'
- order by create_time desc
- </select>
- <select id="findPage" parameterType="platform.modules.government.dto.ParamApplication"
- resultType="platform.modules.government.dto.ProjectFillingDto">
- SELECT
- application.id id,
- application.apply_no apply_no,
- company.company_name company_name,
- declaration.project_type project_type,
- declaration.project_service_type project_service_type,
- declaration.project_source project_source,
- application.approve_status approve_status
- FROM
- project_filling application
- LEFT JOIN z_approval approval ON approval.APPLY_ID = application.id
- AND approval.TYPE = #{project.approval_type}
- LEFT JOIN y_company company ON company.id = application.company_id
- LEFT JOIN project_filling_declaration declaration ON declaration.id = application.declaration_id
- LEFT JOIN project_service_type servicetype ON declaration.project_service_type = servicetype.id
- WHERE
- 1 = 1
- <if test="project.projectIds.size() > 0 ">
- AND application.id IN
- <foreach collection="project.projectIds" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="project.projectIds.size() == 0 ">
- AND application.id=0
- </if>
- <if test="project.project_type != null and project.project_type != '' ">
- AND declaration.project_type = #{project.project_type}
- </if>
- <if test="project.project_source != null and project.project_source != '' ">
- AND declaration.project_source = #{project.project_source}
- </if>
- <if test="project.company_name != null and project.company_name != '' ">
- AND company.company_name LIKE CONCAT('%',#{project.company_name},'%')
- </if>
- <if test="project.project_name != null and project.project_name != '' ">
- AND declaration.project_name LIKE CONCAT('%',#{project.project_name},'%')
- </if>
- <if test="project.project_service_type_name != null and project.project_service_type_name != '' ">
- AND servicetype.service_type_name LIKE CONCAT('%',#{project.project_service_type_name},'%')
- </if>
- GROUP BY application.id
- ORDER BY application.create_time DESC
- </select>
- <select id="findUnionProjectsOnHome" resultType="platform.modules.government.entity.ProjectDeclaration">
- SELECT
- a.id,a.project_name,a.create_time,a.project_source,a.apply_enddate,2 as isFilling
- FROM project_filling_declaration a
- where
- a.del_flag=0
- and a.status = 1
- <if test="request.type != null and request.type != ''">
- AND a.project_source = #{request.type}
- </if>
- order by a.create_time desc
- </select>
- <select id="findMessageByIdAndType" resultType="platform.modules.government.dto.ProjectMessageDto">
- SELECT
- c.company_name,d.create_time,d.is_read
- FROM
- c_message m
- LEFT JOIN c_message_detail d ON m.id = d.message_id
- LEFT JOIN y_company c on d.push_id=c.id
- WHERE
- m.apply_id = #{id}
- and m.business_type = #{type}
- </select>
- <select id="findByDeclarationId" resultType="platform.modules.company.entity.ProjectFilling">
- select * from project_filling WHERE declaration_id = #{id}
- </select>
- <select id="findByProjectIdAndApproveStatus" resultType="platform.modules.company.entity.ProjectFilling">
- select * from project_filling
- where del_flag = 0
- <if test="null != approveStatus and approveStatus.size >0">
- AND approve_status IN
- <foreach collection="approveStatus" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="findAll" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT
- p.*
- FROM
- project_filling p
- left join project_filling_declaration d on p.declaration_id = d.id
- inner join project_service_type t on d.project_service_type = t.id and t.del_flag = 0
- WHERE p.apply_status != 0
- <if test="searchCondition.begin_date != null and searchCondition.begin_date != ''">
- AND p.apply_date <![CDATA[>=]]> #{searchCondition.begin_date}
- </if>
- <if test="searchCondition.end_date != null and searchCondition.end_date != ''">
- AND p.apply_date <![CDATA[<=]]> #{searchCondition.end_date}
- </if>
- <if test="searchCondition.projectType != null and searchCondition.projectType != ''">
- AND d.project_service_type = #{searchCondition.projectType}
- </if>
- </select>
- <select id="findListByCondition" resultType="platform.modules.company.entity.ProjectFilling">
- SELECT
- *
- FROM
- project_filling
- WHERE
- 1=1
- <if test="condition.begin_date != null and condition.begin_date !='' ">
- <![CDATA[ and DATE_FORMAT(create_time, '%Y-%m-%d')>= DATE_FORMAT(#{condition.begin_date}, '%Y-%m-%d') ]]>
- </if>
- <if test="condition.end_date != null and condition.end_date !='' ">
- <![CDATA[ and DATE_FORMAT(create_time, '%Y-%m-%d')<= DATE_FORMAT(#{condition.end_date}, '%Y-%m-%d') ]]>
- </if>
- </select>
- </mapper>
|