ProjectIntelligentDao.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="platform.modules.company.dao.ProjectIntelligentDao">
  4. <!-- 企业我的项目填报列表 -->
  5. <select id="findByCondition" resultType="platform.modules.company.entity.ProjectProvinces">
  6. SELECT DISTINCT
  7. a.id,
  8. a.company_id,
  9. a.apply_no,
  10. a.apply_date,
  11. a.receive_date,
  12. a.declaration_id,
  13. a.apply_status,
  14. a.approve_status,
  15. a.create_time,
  16. a.create_by,
  17. d.project_source as project_source,
  18. c.company_name as company_name
  19. FROM
  20. project_intelligent a
  21. LEFT JOIN y_company c on c.id = a.company_id
  22. LEFT JOIN project_intelligent_declaration d on d.id = a.declaration_id
  23. WHERE
  24. a.del_flag = '0'
  25. <if test="searchCondition.company_id!=null and searchCondition.company_id!=''">
  26. and a.company_id = #{searchCondition.company_id}
  27. </if>
  28. <if test="searchCondition.apply_status!=null and searchCondition.apply_status!=''">
  29. and a.apply_status = #{searchCondition.apply_status}
  30. </if>
  31. <if test="searchCondition.approve_status!=null and searchCondition.approve_status!=''">
  32. and a.approve_status=#{searchCondition.approve_status}
  33. </if>
  34. <if test="searchCondition.startTime!=null and searchCondition.startTime!=''">
  35. and a.apply_date &gt;= #{searchCondition.startTime}
  36. </if>
  37. <if test="searchCondition.endTime!=null and searchCondition.endTime!=''">
  38. and a.apply_date &lt;= #{searchCondition.endTime}
  39. </if>
  40. order by create_time desc
  41. </select>
  42. <select id="findApplyById" resultType="platform.modules.company.entity.ProjectIntelligent">
  43. SELECT DISTINCT
  44. a.id,
  45. a.company_id,
  46. a.apply_no,
  47. a.apply_date,
  48. a.receive_date,
  49. a.declaration_id,
  50. a.apply_status,
  51. a.approve_status,
  52. a.category_id,
  53. a.project_id,
  54. a.project_type_name,
  55. a.is_statement,
  56. a.create_time,
  57. a.create_by,
  58. d.project_source as project_source,
  59. c.company_name as company_name,
  60. g1.project_type_name super_type_name,
  61. g2.project_type_name service_type_name
  62. FROM
  63. project_intelligent a
  64. LEFT JOIN y_company c on c.id = a.company_id
  65. LEFT JOIN project_intelligent_declaration d on d.id = a.declaration_id
  66. LEFT JOIN project_service_category g1 on g1.id = a.category_id
  67. LEFT JOIN project_service_category g2 on g2.id = a.project_id
  68. WHERE
  69. a.del_flag = '0' and a.id = #{apply_id}
  70. </select>
  71. <select id="findPage" parameterType="platform.modules.government.dto.ParamApplication"
  72. resultType="platform.modules.government.dto.ProjectIntelligentDto">
  73. SELECT
  74. application.id id,
  75. application.apply_no apply_no,
  76. company.company_name company_name,
  77. declaration.project_service_type project_service_type,
  78. declaration.project_source project_source,
  79. declaration.project_name project_name,
  80. application.approve_status approve_status,
  81. category.project_type_name project_type_name,
  82. category.type type
  83. FROM
  84. project_intelligent application
  85. LEFT JOIN z_approval approval ON approval.APPLY_ID = application.id
  86. AND approval.TYPE = #{project.approval_type}
  87. LEFT JOIN y_company company ON company.id = application.company_id
  88. LEFT JOIN project_intelligent_declaration declaration ON declaration.id = application.declaration_id
  89. LEFT JOIN project_service_type servicetype ON declaration.project_service_type = servicetype.id
  90. LEFT JOIN project_service_category category ON application.project_id = category.id
  91. WHERE
  92. 1 = 1
  93. AND application.apply_status != '0'
  94. <if test="project.projectIds.size() > 0 ">
  95. AND application.id IN
  96. <foreach collection="project.projectIds" index="index" item="item" open="(" separator="," close=")">
  97. #{item}
  98. </foreach>
  99. </if>
  100. <if test="project.projectIds.size() == 0 ">
  101. AND application.id=0
  102. </if>
  103. <if test="project.project_type != null and project.project_type != '' ">
  104. AND declaration.project_type = #{project.project_type}
  105. </if>
  106. <if test="project.project_source != null and project.project_source != '' ">
  107. AND declaration.project_source = #{project.project_source}
  108. </if>
  109. <if test="project.company_name != null and project.company_name != '' ">
  110. AND company.company_name LIKE CONCAT('%',#{project.company_name},'%')
  111. </if>
  112. <if test="project.project_name != null and project.project_name != '' ">
  113. AND declaration.project_name LIKE CONCAT('%',#{project.project_name},'%')
  114. </if>
  115. <if test="project.project_service_type_name != null and project.project_service_type_name != '' ">
  116. AND servicetype.service_type_name LIKE CONCAT('%',#{project.project_service_type_name},'%')
  117. </if>
  118. <if test="project.approval_status != null and project.approval_status != '' ">
  119. AND application.approve_status =#{project.approval_status}
  120. </if>
  121. GROUP BY application.id
  122. ORDER BY application.create_time DESC
  123. </select>
  124. <select id="findByProjectIdAndApproveStatus" resultType="platform.modules.company.entity.ProjectIntelligent">
  125. select * from project_intelligent
  126. where del_flag = 0
  127. <if test="null != approveStatus and approveStatus.size >0">
  128. AND approve_status IN
  129. <foreach collection="approveStatus" index="index" item="item" open="(" separator="," close=")">
  130. #{item}
  131. </foreach>
  132. </if>
  133. <if test="null != companyIds and companyIds.size >0">
  134. AND company_id IN
  135. <foreach collection="companyIds" index="index" item="item" open="(" separator="," close=")">
  136. #{item}
  137. </foreach>
  138. </if>
  139. </select>
  140. <select id="findIntelligentList" resultType="platform.modules.company.entity.ProjectIntelligent">
  141. SELECT
  142. p.*,
  143. pd.project_source as project_source
  144. FROM
  145. project_intelligent p
  146. LEFT JOIN project_Intelligent_declaration pd ON pd.id = p.declaration_id
  147. WHERE
  148. p.del_flag = false
  149. <if test="searchCondition.companyId != null and searchCondition.companyId != ''">
  150. AND p.company_id = #{searchCondition.companyId}
  151. </if>
  152. <if test="searchCondition.streetId != null and searchCondition.streetId != ''">
  153. AND p.street_id = #{searchCondition.streetId}
  154. </if>
  155. <if test="searchCondition.project_service_type != null and searchCondition.project_service_type != ''">
  156. AND pd.project_service_type LIKE CONCAT ('%', #{searchCondition.project_service_type}, '%')
  157. </if>
  158. <if test="searchCondition.project_source != null and searchCondition.project_source != ''">
  159. AND pd.project_source = #{searchCondition.project_source}
  160. </if>
  161. <if test="searchCondition.approve_status != null and searchCondition.approve_status != ''">
  162. AND p.approve_status = #{searchCondition.approve_status}
  163. </if>
  164. ORDER BY p.create_time DESC
  165. </select>
  166. <select id="findAll" resultType="platform.modules.company.entity.ProjectIntelligent">
  167. SELECT
  168. p.*,c.type apply_type
  169. FROM
  170. project_intelligent p
  171. left join project_service_category c on p.project_id = c.id
  172. WHERE p.apply_status != 0
  173. <if test="searchCondition.begin_date != null and searchCondition.begin_date != ''">
  174. AND p.apply_date <![CDATA[>=]]> #{searchCondition.begin_date}
  175. </if>
  176. <if test="searchCondition.end_date != null and searchCondition.end_date != ''">
  177. AND p.apply_date <![CDATA[<=]]> #{searchCondition.end_date}
  178. </if>
  179. </select>
  180. <select id="findListByCondition" resultType="platform.modules.company.entity.ProjectIntelligent">
  181. SELECT
  182. *
  183. FROM
  184. project_intelligent
  185. WHERE
  186. 1=1
  187. <if test="condition.begin_date != null and condition.begin_date !='' ">
  188. <![CDATA[ and DATE_FORMAT(create_time, '%Y-%m-%d')>= DATE_FORMAT(#{condition.begin_date}, '%Y-%m-%d') ]]>
  189. </if>
  190. <if test="condition.end_date != null and condition.end_date !='' ">
  191. <![CDATA[ and DATE_FORMAT(create_time, '%Y-%m-%d')<= DATE_FORMAT(#{condition.end_date}, '%Y-%m-%d') ]]>
  192. </if>
  193. </select>
  194. </mapper>