JkxlMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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.sg.mapper.JkxlMapper">
  4. <select id="getValue" parameterType="String" resultType="com.jeeplus.modules.sg.entity.RuleRatio">
  5. select value from sg_rule_ratio
  6. <where>
  7. ratio_name = #{ratioName}
  8. </where>
  9. </select>
  10. <select id="getList" parameterType="String" resultType="com.jeeplus.modules.sg.entity.JkxlData">
  11. SELECT
  12. a.describe,
  13. a.short_id as wbsCode,
  14. a.parent_node as parentNode,
  15. a.state,
  16. b.id,
  17. b.original_total_cost as originalTotalCost,
  18. b.original_rg_cost as originalRgCost,
  19. b.original_cbr_cost as originalCbrCost,
  20. b.original_fbr_cost as originalFbrCost,
  21. b.original_jx_cost as originalJxCost,
  22. b.rg_cost as rgCost,
  23. b.cbr_cost as cbrCost,
  24. b.fbr_cost as fbrCost,
  25. b.jx_cost as jxCost,
  26. b.measures_fee1 as measuresFee1,
  27. b.measures_fee2 as measuresFee2,
  28. b.other_cost as otherCost,
  29. b.tex as tex,
  30. b.fees as fees,
  31. b.zjgc_fee as zjgcFee,
  32. b.total_fee as totalFee,
  33. b.original_rate as originalRate,
  34. b.bz_fee as bzFee,
  35. b.jk_fee as jkFee,
  36. b.rg_fee_ft as rgFtFee,
  37. b.cbr_fee_ft as cbrFtFee,
  38. b.fbr_fee_ft as fbrFtFee,
  39. b.jx_fee_ft as jxFtFee
  40. FROM sg_wbs_elements_data a LEFT JOIN sg_wbs_fee b on a.short_id = b.wbs_code
  41. and b.id = #{id}
  42. </select>
  43. <select id="getData" resultType="com.jeeplus.modules.sg.entity.JkxlData">
  44. SELECT
  45. a.describe,
  46. a.short_id as wbsCode,
  47. a.parent_node as parentNode,
  48. a.state,
  49. b.id,
  50. b.original_total_cost as originalTotalCost,
  51. b.original_rg_cost as originalRgCost,
  52. b.original_cbr_cost as originalCbrCost,
  53. b.original_fbr_cost as originalFbrCost,
  54. b.original_jx_cost as originalJxCost,
  55. b.rg_cost as rgCost,
  56. b.cbr_cost as cbrCost,
  57. b.fbr_cost as fbrCost,
  58. b.jx_cost as jxCost,
  59. b.measures_fee1 as measuresFee1,
  60. b.measures_fee2 as measuresFee2,
  61. b.measures_fee3 as measuresFee3,
  62. b.other_cost as otherCost,
  63. b.tex as tex,
  64. b.fees as fees,
  65. b.zjgc_fee as zjgcFee,
  66. b.total_fee as totalFee,
  67. b.original_rate as originalRate,
  68. b.bz_fee as bzFee,
  69. b.jk_fee as jkFee,
  70. b.rg_fee_ft as rgFtFee,
  71. b.cbr_fee_ft as cbrFtFee,
  72. b.fbr_fee_ft as fbrFtFee,
  73. b.jx_fee_ft as jxFtFee
  74. FROM sg_wbs_elements_data a LEFT JOIN sg_wbs_fee b on a.short_id = b.wbs_code
  75. <where>
  76. b.id = #{id} and a.short_id = #{wbsCode}
  77. </where>
  78. </select>
  79. <select id="findList" parameterType="String" resultType="com.jeeplus.modules.sg.entity.JkxlData">
  80. SELECT
  81. a.id as wbsId,
  82. a.project_id as projectId,
  83. a.describe,
  84. a.short_id as wbsCode,
  85. a.subject_allocate as subjectAllocate,
  86. a.mount_matter as mountMatter,
  87. a.mount_server as mountServer,
  88. b.total_fee as totalFee
  89. FROM sg_wbs_elements a LEFT JOIN sg_wbs_fee b on a.short_id = b.wbs_code
  90. and b.id = #{id}
  91. order by a.id
  92. </select>
  93. <insert id="save" parameterType="com.jeeplus.modules.sg.entity.JkxlData">
  94. insert into sg_wbs_fee
  95. (id,
  96. wbs_code,
  97. original_total_cost,
  98. original_rate,
  99. original_rg_cost,
  100. original_cbr_cost,
  101. original_fbr_cost,
  102. original_jx_cost,
  103. rg_cost,
  104. cbr_cost,
  105. fbr_cost,
  106. jx_cost,
  107. measures_fee1,
  108. measures_fee2,
  109. measures_fee3,
  110. other_cost,
  111. fees,
  112. tex,
  113. total_fee,
  114. bz_fee,
  115. jk_fee,
  116. zjgc_fee,
  117. rg_fee_ft,
  118. cbr_fee_ft,
  119. fbr_fee_ft,
  120. jx_fee_ft
  121. ) values (
  122. #{id},
  123. #{wbsCode},
  124. #{originalTotalCost},
  125. #{originalRate},
  126. #{originalRgCost},
  127. #{originalCbrCost},
  128. #{originalFbrCost},
  129. #{originalJxCost},
  130. #{rgCost},
  131. #{cbrCost},
  132. #{fbrCost},
  133. #{jxCost},
  134. #{measuresFee1},
  135. #{measuresFee2},
  136. #{measuresFee3},
  137. #{otherCost},
  138. #{fees},
  139. #{tex},
  140. #{totalFee},
  141. #{bzFee},
  142. #{jkFee},
  143. #{zjgcFee},
  144. #{rgFtFee},
  145. #{cbrFtFee},
  146. #{fbrFtFee},
  147. #{jxFtFee}
  148. )
  149. </insert>
  150. <update id="updateDate" parameterType="com.jeeplus.modules.sg.entity.WbsProject">
  151. update sg_wbs_fee set
  152. <if test="rgFtFee != null and rgFtFee != ''">
  153. rg_fee_ft = #{rgFtFee},
  154. </if>
  155. <if test="cbrFtFee != null and cbrFtFee != ''">
  156. cbr_fee_ft = #{cbrFtFee},
  157. </if>
  158. <if test="fbrFtFee != null and fbrFtFee != ''">
  159. fbr_fee_ft = #{fbrFtFee},
  160. </if>
  161. <if test="jxFtFee != null and jxFtFee != ''">
  162. jx_fee_ft = #{jxFtFee},
  163. </if>
  164. <if test="measuresFee1 != null and measuresFee1 != ''">
  165. measures_fee1 = #{measuresFee1},
  166. </if>
  167. <if test="measuresFee2 != null and measuresFee2 != ''">
  168. measures_fee2 = #{measuresFee2},
  169. </if>
  170. <if test="measuresFee3 != null and measuresFee3 != ''">
  171. measures_fee3 = #{measuresFee3},
  172. </if>
  173. <if test="otherCost != null and otherCost != ''">
  174. other_cost = #{otherCost},
  175. </if>
  176. <if test="fees != null and fees != ''">
  177. fees = #{fees},
  178. </if>
  179. <if test="tex != null and tex != ''">
  180. tex = #{tex},
  181. </if>
  182. <if test="totalFee != null and totalFee != ''">
  183. total_fee = #{totalFee},
  184. </if>
  185. id = #{id}
  186. <where>
  187. id = #{id} and wbs_code = #{wbsCode}
  188. </where>
  189. </update>
  190. <select id="getTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData" resultType="com.jeeplus.modules.sg.entity.TzData">
  191. select id,type,fee from sg_wbs_fee_tz
  192. <where>
  193. <if test="type != null and type != ''">
  194. type = #{type} and
  195. </if>
  196. id = #{id}
  197. </where>
  198. order by type
  199. </select>
  200. <update id="updateTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData">
  201. update sg_wbs_fee_tz set fee = #{fee}
  202. <where>
  203. <if test="type != null and type != ''">
  204. type = #{type} and
  205. </if>
  206. id = #{id}
  207. </where>
  208. </update>
  209. <insert id="saveTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData">
  210. insert into sg_wbs_fee_tz
  211. (
  212. id,
  213. type,
  214. fee
  215. )values (
  216. #{id},
  217. #{type},
  218. #{fee}
  219. )
  220. </insert>
  221. <insert id="saveProject" parameterType="com.jeeplus.modules.sg.entity.WbsProject">
  222. insert into sg_wbs_project
  223. (id,
  224. project_name,
  225. create_date
  226. ) values (
  227. #{id},
  228. #{name},
  229. #{createDate}
  230. )
  231. </insert>
  232. </mapper>