综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmcBudgetMapper.xml 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.oa.mapper.CmcBudgetMapper">
  6. <resultMap type="CmcBudget" id="CmcBudgetResult">
  7. <result property="budgetId" column="budget_id" />
  8. <result property="projectId" column="project_id" />
  9. <result property="staffCost" column="staff_cost" />
  10. <result property="carCost" column="car_cost" />
  11. <result property="deviceCost" column="device_cost" />
  12. <result property="fixCost" column="fix_cost" />
  13. <result property="settleExpense" column="settle_expense" />
  14. <result property="outExpense" column="out_expense" />
  15. <result property="businessExpense" column="business_expense" />
  16. <result property="taxExpense" column="tax_expense" />
  17. <result property="rentExpense" column="rent_expense" />
  18. <result property="otherExpense" column="other_expense" />
  19. <result property="outRemark" column="out_remark" />
  20. <result property="businessRemark" column="business_remark" />
  21. <result property="taxRemark" column="tax_remark" />
  22. <result property="rentRemark" column="rent_remark" />
  23. <result property="otherRemark" column="other_remark" />
  24. <result property="directExpense" column="direct_expense" />
  25. <result property="totalBudget" column="total_budget" />
  26. <result property="compiler" column="compiler" />
  27. <result property="auditor" column="auditor" />
  28. <result property="createTime" column="create_time" />
  29. <association property="compilerUser" javaType="SysUser" resultMap="CompilerResult" />
  30. <association property="auditorUser" javaType="SysUser" resultMap="AuditorResult" />
  31. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  32. </resultMap>
  33. <resultMap type="SysUser" id="CompilerResult">
  34. <result property="userId" column="user_id" />
  35. <result property="nickName" column="compiler_nick_name" />
  36. </resultMap>
  37. <resultMap type="SysUser" id="AuditorResult">
  38. <result property="userId" column="user_id" />
  39. <result property="nickName" column="auditor_nick_name" />
  40. </resultMap>
  41. <resultMap type="CmcProject" id="CmcProjectResult">
  42. <result property="projectId" column="project_id" />
  43. <result property="projectNumber" column="project_number" />
  44. <result property="projectName" column="project_name" />
  45. </resultMap>
  46. <sql id="selectCmcBudgetVo">
  47. select b.budget_id, b.project_id, p.project_number, p.project_name, b.staff_cost, b.car_cost, b.device_cost, b.fix_cost, b.settle_expense, b.out_expense, b.business_expense, b.tax_expense,
  48. b.rent_expense, b.other_expense, b.out_remark, b.business_remark, b.tax_remark, b.rent_remark, b.other_remark, b.direct_expense, b.total_budget, b.compiler,
  49. u.nick_name as compiler_nick_name, b.auditor, u1.nick_name as auditor_nick_name, b.create_time from cmc_budget as b
  50. left join sys_user as u on u.user_id = b.compiler
  51. left join sys_user as u1 on u1.user_id = b.auditor
  52. left join cmc_project as p on b.project_id = p.project_id
  53. </sql>
  54. <select id="selectCmcBudgetList" parameterType="CmcBudget" resultMap="CmcBudgetResult">
  55. <include refid="selectCmcBudgetVo"/>
  56. <where>
  57. <if test="projectId != null and projectId != ''"> and b.project_id = #{projectId}</if>
  58. <if test="staffCost != null "> and b.staff_cost = #{staffCost}</if>
  59. <if test="carCost != null "> and b.car_cost = #{carCost}</if>
  60. <if test="deviceCost != null "> and b.device_cost = #{deviceCost}</if>
  61. <if test="fixCost != null "> and b.fix_cost = #{fixCost}</if>
  62. <if test="settleExpense != null "> and b.settle_expense = #{settleExpense}</if>
  63. <if test="outExpense != null "> and b.out_expense = #{outExpense}</if>
  64. <if test="businessExpense != null "> and b.business_expense = #{businessExpense}</if>
  65. <if test="rentExpense != null "> and b.rent_expense = #{rentExpense}</if>
  66. <if test="otherExpense != null "> and b.other_expense = #{otherExpense}</if>
  67. <if test="directExpense != null "> and b.direct_expense = #{directExpense}</if>
  68. <if test="totalBudget != null "> and b.total_budget = #{totalBudget}</if>
  69. <if test="compiler != null "> and b.compiler = #{compiler}</if>
  70. <if test="auditor != null "> and b.auditor = #{auditor}</if>
  71. </where>
  72. </select>
  73. <select id="selectCmcBudgetByBudgetId" parameterType="String" resultMap="CmcBudgetResult">
  74. <include refid="selectCmcBudgetVo"/>
  75. where budget_id = #{budgetId}
  76. </select>
  77. <insert id="insertCmcBudget" parameterType="CmcBudget">
  78. insert into cmc_budget
  79. <trim prefix="(" suffix=")" suffixOverrides=",">
  80. <if test="budgetId != null">budget_id,</if>
  81. <if test="projectId != null">project_id,</if>
  82. <if test="staffCost != null">staff_cost,</if>
  83. <if test="carCost != null">car_cost,</if>
  84. <if test="deviceCost != null">device_cost,</if>
  85. <if test="fixCost != null">fix_cost,</if>
  86. <if test="settleExpense != null">settle_expense,</if>
  87. <if test="outExpense != null">out_expense,</if>
  88. <if test="businessExpense != null">business_expense,</if>
  89. <if test="taxExpense != null">tax_expense,</if>
  90. <if test="rentExpense != null">rent_expense,</if>
  91. <if test="otherExpense != null">other_expense,</if>
  92. <if test="outRemark != null">out_remark,</if>
  93. <if test="businessRemark != null">business_remark,</if>
  94. <if test="taxRemark != null">tax_remark,</if>
  95. <if test="rentRemark != null">rent_remark,</if>
  96. <if test="otherRemark != null">other_remark,</if>
  97. <if test="directExpense != null">direct_expense,</if>
  98. <if test="totalBudget != null">total_budget,</if>
  99. <if test="compiler != null">compiler,</if>
  100. <if test="auditor != null">auditor,</if>
  101. create_time
  102. </trim>
  103. <trim prefix="values (" suffix=")" suffixOverrides=",">
  104. <if test="budgetId != null">#{budgetId},</if>
  105. <if test="projectId != null">#{projectId},</if>
  106. <if test="staffCost != null">#{staffCost},</if>
  107. <if test="carCost != null">#{carCost},</if>
  108. <if test="deviceCost != null">#{deviceCost},</if>
  109. <if test="fixCost != null">#{fixCost},</if>
  110. <if test="settleExpense != null">#{settleExpense},</if>
  111. <if test="outExpense != null">#{outExpense},</if>
  112. <if test="businessExpense != null">#{businessExpense},</if>
  113. <if test="taxExpense != null">#{taxExpense},</if>
  114. <if test="rentExpense != null">#{rentExpense},</if>
  115. <if test="otherExpense != null">#{otherExpense},</if>
  116. <if test="outRemark != null">#{outRemark},</if>
  117. <if test="businessRemark != null">#{businessRemark},</if>
  118. <if test="taxRemark != null">#{taxRemark},</if>
  119. <if test="rentRemark != null">#{rentRemark},</if>
  120. <if test="otherRemark != null">#{otherRemark},</if>
  121. <if test="directExpense != null">#{directExpense},</if>
  122. <if test="totalBudget != null">#{totalBudget},</if>
  123. <if test="compiler != null">#{compiler},</if>
  124. <if test="auditor != null">#{auditor},</if>
  125. sysdate()
  126. </trim>
  127. </insert>
  128. <update id="updateCmcBudget" parameterType="CmcBudget">
  129. update cmc_budget
  130. <trim prefix="SET" suffixOverrides=",">
  131. <if test="projectId != null">project_id = #{projectId},</if>
  132. <if test="staffCost != null">staff_cost = #{staffCost},</if>
  133. <if test="carCost != null">car_cost = #{carCost},</if>
  134. <if test="deviceCost != null">device_cost = #{deviceCost},</if>
  135. <if test="fixCost != null">fix_cost = #{fixCost},</if>
  136. <if test="settleExpense != null">settle_expense = #{settleExpense},</if>
  137. <if test="outExpense != null">out_expense = #{outExpense},</if>
  138. <if test="businessExpense != null">business_expense = #{businessExpense},</if>
  139. <if test="taxExpense != null">tax_expense = #{taxExpense},</if>
  140. <if test="rentExpense != null">rent_expense = #{rentExpense},</if>
  141. <if test="otherExpense != null">other_expense = #{otherExpense},</if>
  142. <if test="outRemark != null">out_remark = #{outRemark},</if>
  143. <if test="businessRemark != null">business_remark = #{businessRemark},</if>
  144. <if test="taxRemark != null">tax_remark = #{taxRemark},</if>
  145. <if test="rentRemark != null">rent_remark = #{rentRemark},</if>
  146. <if test="otherRemark != null">other_remark = #{otherRemark},</if>
  147. <if test="directExpense != null">direct_expense = #{directExpense},</if>
  148. <if test="totalBudget != null">total_budget = #{totalBudget},</if>
  149. <if test="compiler != null">compiler = #{compiler},</if>
  150. <if test="auditor != null">auditor = #{auditor},</if>
  151. <if test="createTime != null">create_time = #{createTime},</if>
  152. </trim>
  153. where budget_id = #{budgetId}
  154. </update>
  155. <delete id="deleteCmcBudgetByBudgetId" parameterType="String">
  156. delete from cmc_budget where budget_id = #{budgetId}
  157. </delete>
  158. <delete id="deleteCmcBudgetByBudgetIds" parameterType="String">
  159. delete from cmc_budget where budget_id in
  160. <foreach item="budgetId" collection="array" open="(" separator="," close=")">
  161. #{budgetId}
  162. </foreach>
  163. </delete>
  164. </mapper>