| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.ProjectApplicationDao">
- <!-- 街道审批列表 -->
- <select id="findApproveList" resultType="platform.modules.company.entity.ProjectApplication">
- SELECT DISTINCT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.project_type,
- a.project_id,
- a.project_name,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by,
- c.company_name as company_name
- FROM
- project_application a
- LEFT JOIN y_company c on c.id = a.company_id
- LEFT JOIN z_approval approval on approval.apply_id = a.id
- WHERE
- a.del_flag = '0' and a.approve_status is not null
- <if test="searchCondition.street_id!=null and searchCondition.street_id!=''">
- and a.street_id = #{searchCondition.street_id}
- </if>
- <if test="searchCondition.project_type!=null and searchCondition.project_type!=''">
- and a.project_type = #{searchCondition.project_type}
- </if>
- <if test="searchCondition.project_name!=null and searchCondition.project_name!=''">
- and a.project_name like CONCAT ('%',#{searchCondition.project_name},'%')
- </if>
- <if test="searchCondition.company_name!=null and searchCondition.company_name!=''">
- and c.company_name like CONCAT ('%',#{searchCondition.company_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>
- <if test="searchCondition.isPendingAudit == 1"><!-- 为1 ,取待审核数据-->
- <if test="searchCondition.pendingAuditStatus != null and searchCondition.pendingAuditStatus != '' ">
- <!-- 待审批状态的数据 -->
- and a.approve_status = #{searchCondition.pendingAuditStatus}
- </if>
- </if>
- <if test="searchCondition.isPendingAudit == 0"><!-- 为0 ,取已审核数据 ,街道审核过的数据-->
- and a.id in (
- SELECT DISTINCT APPLY_ID FROM z_approval
- WHERE checker = #{searchCondition.checker_id}
- and type = #{searchCondition.approveType}
- )
- <if test="searchCondition.pendingAuditStatus != null and searchCondition.pendingAuditStatus != '' ">
- <!-- 已审批列表去除待审批状态的数据 -->
- and a.approve_status != #{searchCondition.pendingAuditStatus}
- </if>
- </if>
- order by create_time desc
- </select>
- <select id="selectMutexApplications" resultType="platform.modules.company.entity.ProjectApplication">
- SELECT DISTINCT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.project_type,
- a.project_id,
- a.project_name,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by
- FROM
- project_application a
- left join project p on a.project_id = p.id
- where
- a.del_flag = '0'
- and a.company_id = #{company_id}
- and left(a.apply_date,4) = DATE_FORMAT(NOW(), '%Y')
- and p.mutex = #{project.mutex}
- and p.id != #{project.id}
- </select>
- <select id="selectApplicationsByCidAndPid" resultType="platform.modules.company.entity.ProjectApplication">
- SELECT
- a.id,
- a.company_id,
- a.apply_no,
- a.apply_date,
- a.project_type,
- a.project_id,
- a.project_name,
- a.apply_status,
- a.approve_status,
- a.create_time,
- a.create_by
- FROM
- project_application a
- where
- a.del_flag = '0'
- and a.company_id = #{company_id}
- and a.project_id = #{project_id}
- and left(a.apply_date,4) = DATE_FORMAT(NOW(), '%Y')
- </select>
- <select id="canApplyProjectIntelligent" resultType="platform.modules.company.entity.ProjectApplication">
- SELECT
- pa.*
- FROM
- project_application pa
- LEFT JOIN project p ON p.id = pa.project_id
- WHERE
- pa.company_id = #{company}
- AND p.is_technical = 1
- AND pa.del_flag = 0
- </select>
- </mapper>
|