ProjectgeneralDao.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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.jeeplus.modules.project.dao.ProjectgeneralDao">
  4. <sql id="projectgeneralColumns">
  5. a.id AS "id",
  6. a.create_by AS "createBy.id",
  7. a.create_date AS "createDate",
  8. a.update_by AS "updateBy.id",
  9. a.update_date AS "updateDate",
  10. a.remarks AS "remarks",
  11. a.del_flag AS "delFlag",
  12. a.demand_department AS "demandDepartment",
  13. a.project_type AS "projectType",
  14. a.construction_site AS "constructionSite",
  15. a.supervision_unit AS "supervisionUnit",
  16. a.service_classification AS "serviceClassification",
  17. a.fund_attribute AS "fundAttribute",
  18. a.asset_nature AS "assetNature",
  19. a.tender_scope AS "tenderScope",
  20. a.online_bidding AS "onlineBidding",
  21. a.evaluation_expert AS "evaluationExpert",
  22. a.price_ceiling AS "priceCeiling",
  23. a.bid_price_or_bid_control_price AS "bidPriceOrBidControlPrice",
  24. a.bid_price_or_bid_control_price_money AS "bidPriceOrBidControlPriceMoney",
  25. a.bid_evaluation_officer AS "bidEvaluationOfficer",
  26. a.bid_evaluation_staff AS "bidEvaluationStaff",
  27. a.project_id AS "projectId"
  28. </sql>
  29. <sql id="projectgeneralJoins">
  30. </sql>
  31. <select id="get" resultType="Projectgeneral" >
  32. SELECT
  33. <include refid="projectgeneralColumns"/>
  34. FROM project_general a
  35. <include refid="projectgeneralJoins"/>
  36. WHERE a.id = #{id}
  37. </select>
  38. <select id="findList" resultType="Projectgeneral" >
  39. SELECT
  40. <include refid="projectgeneralColumns"/>
  41. FROM project_general a
  42. <include refid="projectgeneralJoins"/>
  43. <where>
  44. a.del_flag = #{DEL_FLAG_NORMAL}
  45. </where>
  46. <choose>
  47. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  48. ORDER BY ${page.orderBy}
  49. </when>
  50. <otherwise>
  51. ORDER BY a.update_date DESC
  52. </otherwise>
  53. </choose>
  54. </select>
  55. <select id="findAllList" resultType="Projectgeneral" >
  56. SELECT
  57. <include refid="projectgeneralColumns"/>
  58. FROM project_general a
  59. <include refid="projectgeneralJoins"/>
  60. <where>
  61. a.del_flag = #{DEL_FLAG_NORMAL}
  62. </where>
  63. <choose>
  64. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  65. ORDER BY ${page.orderBy}
  66. </when>
  67. <otherwise>
  68. ORDER BY a.update_date DESC
  69. </otherwise>
  70. </choose>
  71. </select>
  72. <insert id="insert">
  73. INSERT INTO project_general(
  74. id,
  75. create_by,
  76. create_date,
  77. update_by,
  78. update_date,
  79. remarks,
  80. del_flag,
  81. demand_department,
  82. project_type,
  83. construction_site,
  84. supervision_unit,
  85. service_classification,
  86. fund_attribute,
  87. asset_nature,
  88. tender_scope,
  89. online_bidding,
  90. evaluation_expert,
  91. price_ceiling,
  92. bid_price_or_bid_control_price,
  93. bid_price_or_bid_control_price_money,
  94. bid_evaluation_officer,
  95. bid_evaluation_staff,
  96. project_id
  97. ) VALUES (
  98. #{id},
  99. #{createBy.id},
  100. #{createDate},
  101. #{updateBy.id},
  102. #{updateDate},
  103. #{remarks},
  104. #{delFlag},
  105. #{demandDepartment},
  106. #{projectType},
  107. #{constructionSite},
  108. #{supervisionUnit},
  109. #{serviceClassification},
  110. #{fundAttribute},
  111. #{assetNature},
  112. #{tenderScope},
  113. #{onlineBidding},
  114. #{evaluationExpert},
  115. #{priceCeiling},
  116. #{bidPriceOrBidControlPrice},
  117. #{bidPriceOrBidControlPriceMoney},
  118. #{bidEvaluationOfficer},
  119. #{bidEvaluationStaff},
  120. #{projectId}
  121. )
  122. </insert>
  123. <update id="update">
  124. UPDATE project_general SET
  125. update_by = #{updateBy.id},
  126. update_date = #{updateDate},
  127. remarks = #{remarks},
  128. demand_department = #{demandDepartment},
  129. project_type = #{projectType},
  130. construction_site = #{constructionSite},
  131. supervision_unit = #{supervisionUnit},
  132. service_classification = #{serviceClassification},
  133. fund_attribute = #{fundAttribute},
  134. asset_nature = #{assetNature},
  135. tender_scope = #{tenderScope},
  136. online_bidding = #{onlineBidding},
  137. evaluation_expert = #{evaluationExpert},
  138. price_ceiling = #{priceCeiling},
  139. bid_price_or_bid_control_price = #{bidPriceOrBidControlPrice},
  140. bid_price_or_bid_control_price_money = #{bidPriceOrBidControlPriceMoney},
  141. bid_evaluation_officer = #{bidEvaluationOfficer},
  142. bid_evaluation_staff = #{bidEvaluationStaff},
  143. project_id = #{projectId}
  144. WHERE id = #{id}
  145. </update>
  146. <!--物理删除-->
  147. <update id="delete">
  148. DELETE FROM project_general
  149. WHERE id = #{id}
  150. </update>
  151. <!--逻辑删除-->
  152. <update id="deleteByLogic">
  153. UPDATE project_general SET
  154. del_flag = #{DEL_FLAG_DELETE}
  155. WHERE id = #{id}
  156. </update>
  157. <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
  158. <select id="findUniqueByProperty" resultType="Projectgeneral" statementType="STATEMENT">
  159. select * FROM project_general where ${propertyName} = '${value}'
  160. </select>
  161. </mapper>