JkxlMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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.total_fee as totalFee,
  32. b.original_rate as originalRate,
  33. b.bz_fee as bzFee,
  34. b.jk_fee as jkFee
  35. FROM sg_wbs_elements_data a LEFT JOIN sg_wbs_fee b on a.short_id = b.wbs_code
  36. and b.id = #{id}
  37. </select>
  38. <select id="findList" parameterType="String" resultType="com.jeeplus.modules.sg.entity.JkxlData">
  39. SELECT
  40. a.id as wbsId,
  41. a.project_id as projectId,
  42. a.describe,
  43. a.short_id as wbsCode,
  44. a.subject_allocate as subjectAllocate,
  45. a.mount_matter as mountMatter,
  46. a.mount_server as mountServer,
  47. b.total_fee as totalFee
  48. FROM sg_wbs_elements a LEFT JOIN sg_wbs_fee b on a.short_id = b.wbs_code
  49. and b.id = #{id}
  50. order by short_id
  51. </select>
  52. <insert id="save" parameterType="com.jeeplus.modules.sg.entity.JkxlData">
  53. insert into sg_wbs_fee
  54. (id,
  55. wbs_code,
  56. original_total_cost,
  57. original_rate,
  58. original_rg_cost,
  59. original_cbr_cost,
  60. original_fbr_cost,
  61. original_jx_cost,
  62. rg_cost,
  63. cbr_cost,
  64. fbr_cost,
  65. jx_cost,
  66. measures_fee1,
  67. measures_fee2,
  68. other_cost,
  69. fees,
  70. tex,
  71. total_fee,
  72. bz_fee,
  73. jk_fee
  74. ) values (
  75. #{id},
  76. #{wbsCode},
  77. #{originalTotalCost},
  78. #{originalRate},
  79. #{originalRgCost},
  80. #{originalCbrCost},
  81. #{originalFbrCost},
  82. #{originalJxCost},
  83. #{rgCost},
  84. #{cbrCost},
  85. #{fbrCost},
  86. #{jxCost},
  87. #{measuresFee1},
  88. #{measuresFee2},
  89. #{otherCost},
  90. #{fees},
  91. #{tex},
  92. #{totalFee},
  93. #{bzFee},
  94. #{jkFee}
  95. )
  96. </insert>
  97. <insert id="saveProject" parameterType="com.jeeplus.modules.sg.entity.WbsProject">
  98. insert into sg_wbs_project
  99. (id,
  100. project_name,
  101. create_date
  102. ) values (
  103. #{id},
  104. #{name},
  105. #{createDate}
  106. )
  107. </insert>
  108. <!--<update id="updateData" parameterType="com.jeeplus.modules.sg.entity.WbsProject">-->
  109. <!--update sg_wbs_fee set-->
  110. <!--<where>-->
  111. <!--id = #{id} and wbs_code = #{wbsCode}-->
  112. <!--</where>-->
  113. <!--</update>-->
  114. <select id="getTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData" resultType="com.jeeplus.modules.sg.entity.TzData">
  115. select id,type,fee from sg_wbs_fee_tz
  116. <where>
  117. <if test="type != null and type != ''">
  118. type = #{type} and
  119. </if>
  120. id = #{id}
  121. </where>
  122. order by type
  123. </select>
  124. <update id="updateTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData">
  125. update sg_wbs_fee_tz set fee = #{fee}
  126. <where>
  127. <if test="type != null and type != ''">
  128. type = #{type} and
  129. </if>
  130. id = #{id}
  131. </where>
  132. </update>
  133. <insert id="saveTzFee" parameterType="com.jeeplus.modules.sg.entity.TzData">
  134. insert into sg_wbs_fee_tz
  135. (
  136. id,
  137. type,
  138. fee
  139. )values (
  140. #{id},
  141. #{type},
  142. #{fee}
  143. )
  144. </insert>
  145. </mapper>