| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <?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.ProjectIntelligentDao">
- <!-- 企业我的项目填报列表 -->
- <select id="findByCondition" resultType="platform.modules.company.entity.ProjectProvinces">
- 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_intelligent a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN project_intelligent_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.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.ProjectIntelligent">
- 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.category_id,
- a.project_id,
- a.project_type_name,
- a.is_statement,
- a.create_time,
- a.create_by,
- d.project_source as project_source,
- c.company_name as company_name,
- g1.project_type_name super_type_name,
- g2.project_type_name service_type_name
- FROM
- project_intelligent a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN project_intelligent_declaration d on d.id = a.declaration_id
- LEFT JOIN project_service_category g1 on g1.id = a.category_id
- LEFT JOIN project_service_category g2 on g2.id = a.project_id
- WHERE
- a.del_flag = '0' and a.id = #{apply_id}
- </select>
- <select id="findPage" parameterType="platform.modules.government.dto.ParamApplication"
- resultType="platform.modules.government.dto.ProjectIntelligentDto">
- SELECT
- application.id id,
- application.apply_no apply_no,
- company.company_name company_name,
- declaration.project_service_type project_service_type,
- declaration.project_source project_source,
- declaration.project_name project_name,
- application.approve_status approve_status,
- category.project_type_name project_type_name,
- category.type type
- FROM
- project_intelligent 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_intelligent_declaration declaration ON declaration.id = application.declaration_id
- LEFT JOIN project_service_type servicetype ON declaration.project_service_type = servicetype.id
- LEFT JOIN project_service_category category ON application.project_id = category.id
- WHERE
- 1 = 1
- AND application.apply_status != '0'
- <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>
- <if test="project.approval_status != null and project.approval_status != '' ">
- AND application.approve_status =#{project.approval_status}
- </if>
- GROUP BY application.id
- ORDER BY application.create_time DESC
- </select>
- <select id="findByProjectIdAndApproveStatus" resultType="platform.modules.company.entity.ProjectIntelligent">
- select * from project_intelligent
- 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>
- <if test="null != companyIds and companyIds.size >0">
- AND company_id IN
- <foreach collection="companyIds" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="findIntelligentList" resultType="platform.modules.company.entity.ProjectIntelligent">
- SELECT
- p.*,
- pd.project_source as project_source
- FROM
- project_intelligent p
- LEFT JOIN project_Intelligent_declaration pd ON pd.id = p.declaration_id
- WHERE
- p.del_flag = false
- <if test="searchCondition.companyId != null and searchCondition.companyId != ''">
- AND p.company_id = #{searchCondition.companyId}
- </if>
- <if test="searchCondition.streetId != null and searchCondition.streetId != ''">
- AND p.street_id = #{searchCondition.streetId}
- </if>
- <if test="searchCondition.project_service_type != null and searchCondition.project_service_type != ''">
- AND pd.project_service_type LIKE CONCAT ('%', #{searchCondition.project_service_type}, '%')
- </if>
- <if test="searchCondition.project_source != null and searchCondition.project_source != ''">
- AND pd.project_source = #{searchCondition.project_source}
- </if>
- <if test="searchCondition.approve_status != null and searchCondition.approve_status != ''">
- AND p.approve_status = #{searchCondition.approve_status}
- </if>
- ORDER BY p.create_time DESC
- </select>
- <select id="findAll" resultType="platform.modules.company.entity.ProjectIntelligent">
- SELECT
- p.*,c.type apply_type
- FROM
- project_intelligent p
- left join project_service_category c on p.project_id = c.id
- 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>
- </select>
- <select id="findListByCondition" resultType="platform.modules.company.entity.ProjectIntelligent">
- SELECT
- *
- FROM
- project_intelligent
- 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>
|