CostProjectApprovalMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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="com.hotent.project.dao.CostProjectApprovalDao">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.hotent.project.model.CostProjectApproval">
  6. <id column="project_id" property="projectId" />
  7. <result column="project_name" property="projectName" />
  8. <result column="audit_group" property="auditGroup" />
  9. <result column="send_type" property="sendType"/>
  10. <result column="catalog_id" property="catalogId" />
  11. <result column="plan_id" property="planId" />
  12. <result column="area_code" property="areaCode" />
  13. <result column="area_level" property="areaLevel" />
  14. <result column="org_id" property="orgId" />
  15. <result column="project_year" property="projectYear" />
  16. <result column="source_type" property="sourceType" />
  17. <result column="audit_type" property="auditType" />
  18. <result column="audit_period" property="auditPeriod" />
  19. <result column="need_hearing" property="needHearing" />
  20. <result column="is_emergency" property="isEmergency" />
  21. <result column="establishment_reason" property="establishmentReason" />
  22. <result column="according_file_url" property="accordingFileUrl" />
  23. <result column="other_file_url" property="otherFileUrl" />
  24. <result column="status" property="status" />
  25. <result column="leader_ids" property="leaderIds" />
  26. <result column="expert_str" property="expertStr" />
  27. <result column="is_deleted" property="isDeleted" />
  28. <result column="create_time" property="createTime" />
  29. <result column="create_by" property="createBy" />
  30. <result column="update_time" property="updateTime" />
  31. <result column="update_by" property="updateBy" />
  32. <result column="project_members" property="projectMembers" />
  33. <result column="audited_unit_id" property="auditedUnitId"/>
  34. <result column="audited_unit_name" property="auditedUnitName"/>
  35. <result column="org_name" property="orgName"/>
  36. </resultMap>
  37. <!-- 通用查询结果列 -->
  38. <sql id="Base_Column_List">
  39. project_id, project_name,audited_unit_name,audit_group, send_type, audited_unit_id,catalog_id, plan_id, area_code, area_level, org_id,org_name, project_year, source_type, audit_type, audit_period, need_hearing, is_emergency, establishment_reason, according_file_url, other_file_url, status, leader_ids, expert_str, is_deleted, create_time, create_by, update_time, update_by, project_members
  40. </sql>
  41. <select id="selectPage" resultMap="BaseResultMap">
  42. select
  43. <include refid="Base_Column_List"/>
  44. from
  45. cost_project_approval
  46. ${ew.customSqlSegment}
  47. </select>
  48. <select id="selectList" resultMap="BaseResultMap">
  49. select
  50. <include refid="Base_Column_List"/>
  51. from
  52. cost_project_approval
  53. ${ew.customSqlSegment}
  54. </select>
  55. <select id="selectById" resultMap="BaseResultMap">
  56. select
  57. <include refid="Base_Column_List"/>
  58. from
  59. cost_project_approval
  60. where
  61. project_id = ${projectId}
  62. </select>
  63. <select id="getCostProjectApprovalPage"
  64. resultMap="BaseResultMap">
  65. SELECT
  66. c.*
  67. FROM
  68. cost_project_approval c,
  69. uc_user u
  70. WHERE
  71. c.create_by=u.ACCOUNT_
  72. <if test=" projectYear != null and projectYear != ''">
  73. and c.project_year=#{projectYear}
  74. </if>
  75. <if test="areaCodes != null and !areaCodes.isEmpty()">
  76. and c.area_code in
  77. <foreach collection="areaCodes" item="code" open="(" separator="," close=")">
  78. #{code}
  79. </foreach>
  80. </if>
  81. <if test=" projectName != null and projectName != ''">
  82. and c.project_name LIKE CONCAT('%', #{projectName}, '%')
  83. </if>
  84. <if test=" dataScope != null and dataScope != ''">
  85. <if test=" dataScope ==1">
  86. and (u.CITY_CODE=#{ cityCode} or c.area_code=#{ cityCode})
  87. </if>
  88. <if test=" dataScope ==2">
  89. and (u.COUNTY_CODE=#{ countyCode} or c.area_code=#{ countyCode})
  90. </if>
  91. </if>
  92. ORDER BY c.create_time DESC
  93. </select>
  94. </mapper>