综合办公系统
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 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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="manager" column="manager" />
  28. <result property="auditor" column="auditor" />
  29. <result property="approver" column="approver" />
  30. <result property="managerComment" column="manager_comment" />
  31. <result property="zjlComment" column="zjl_comment" />
  32. <result property="dszComment" column="dsz_comment" />
  33. <result property="managerTime" column="manager_time" />
  34. <result property="zjlTime" column="zjl_time" />
  35. <result property="dszTime" column="dsz_time" />
  36. <result property="createTime" column="create_time" />
  37. <result property="remark" column="remark" />
  38. <association property="compilerUser" javaType="SysUser" resultMap="CompilerResult" />
  39. <association property="managerUser" javaType="SysUser" resultMap="ManagerResult" />
  40. <association property="zjlUser" javaType="SysUser" resultMap="ZjlResult" />
  41. <association property="dszUser" javaType="SysUser" resultMap="DszResult" />
  42. <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
  43. </resultMap>
  44. <resultMap type="SysUser" id="CompilerResult">
  45. <result property="userId" column="user_id" />
  46. <result property="nickName" column="compiler_nick_name" />
  47. </resultMap>
  48. <resultMap type="SysUser" id="ManagerResult">
  49. <result property="userId" column="user_id" />
  50. <result property="nickName" column="manager_nick_name" />
  51. </resultMap>
  52. <resultMap type="SysUser" id="ZjlResult">
  53. <result property="userId" column="user_id" />
  54. <result property="nickName" column="zjl_nick_name" />
  55. </resultMap>
  56. <resultMap type="SysUser" id="DszResult">
  57. <result property="userId" column="user_id" />
  58. <result property="nickName" column="dsz_nick_name" />
  59. </resultMap>
  60. <resultMap type="CmcProject" id="CmcProjectResult">
  61. <result property="projectId" column="project_id" />
  62. <result property="projectNumber" column="project_number" />
  63. <result property="projectName" column="project_name" />
  64. </resultMap>
  65. <sql id="selectCmcBudgetVo">
  66. 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,
  67. 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,
  68. u.nick_name as compiler_nick_name, b.manager, u1.nick_name as manager_nick_name, b.auditor, u2.nick_name as zjl_nick_name, b.approver, u3.nick_name as dsz_nick_name, b.create_time, b.manager_time, b.zjl_time, b.dsz_time,
  69. b.manager_comment, b.zjl_comment, b.dsz_comment, b.remark from cmc_budget as b
  70. left join sys_user as u on u.user_id = b.compiler
  71. left join sys_user as u1 on u1.user_id = b.manager
  72. left join sys_user as u2 on u2.user_id = b.auditor
  73. left join sys_user as u3 on u3.user_id = b.approver
  74. left join cmc_project as p on b.project_id = p.project_id
  75. </sql>
  76. <select id="selectCmcBudgetList" parameterType="CmcBudget" resultMap="CmcBudgetResult">
  77. <include refid="selectCmcBudgetVo"/>
  78. <where>
  79. <if test="projectId != null and projectId != ''"> and b.project_id = #{projectId}</if>
  80. <if test="staffCost != null "> and b.staff_cost = #{staffCost}</if>
  81. <if test="carCost != null "> and b.car_cost = #{carCost}</if>
  82. <if test="deviceCost != null "> and b.device_cost = #{deviceCost}</if>
  83. <if test="fixCost != null "> and b.fix_cost = #{fixCost}</if>
  84. <if test="settleExpense != null "> and b.settle_expense = #{settleExpense}</if>
  85. <if test="outExpense != null "> and b.out_expense = #{outExpense}</if>
  86. <if test="businessExpense != null "> and b.business_expense = #{businessExpense}</if>
  87. <if test="rentExpense != null "> and b.rent_expense = #{rentExpense}</if>
  88. <if test="otherExpense != null "> and b.other_expense = #{otherExpense}</if>
  89. <if test="directExpense != null "> and b.direct_expense = #{directExpense}</if>
  90. <if test="totalBudget != null "> and b.total_budget = #{totalBudget}</if>
  91. <if test="compiler != null "> and b.compiler = #{compiler}</if>
  92. <if test="auditor != null "> and b.auditor = #{auditor}</if>
  93. </where>
  94. order by b.create_time desc
  95. </select>
  96. <select id="selectCmcBudgetByBudgetId" parameterType="String" resultMap="CmcBudgetResult">
  97. <include refid="selectCmcBudgetVo"/>
  98. where budget_id = #{budgetId}
  99. </select>
  100. <insert id="insertCmcBudget" parameterType="CmcBudget">
  101. insert into cmc_budget
  102. <trim prefix="(" suffix=")" suffixOverrides=",">
  103. <if test="budgetId != null">budget_id,</if>
  104. <if test="projectId != null">project_id,</if>
  105. <if test="staffCost != null">staff_cost,</if>
  106. <if test="carCost != null">car_cost,</if>
  107. <if test="deviceCost != null">device_cost,</if>
  108. <if test="fixCost != null">fix_cost,</if>
  109. <if test="settleExpense != null">settle_expense,</if>
  110. <if test="outExpense != null">out_expense,</if>
  111. <if test="businessExpense != null">business_expense,</if>
  112. <if test="taxExpense != null">tax_expense,</if>
  113. <if test="rentExpense != null">rent_expense,</if>
  114. <if test="otherExpense != null">other_expense,</if>
  115. <if test="outRemark != null">out_remark,</if>
  116. <if test="businessRemark != null">business_remark,</if>
  117. <if test="taxRemark != null">tax_remark,</if>
  118. <if test="rentRemark != null">rent_remark,</if>
  119. <if test="otherRemark != null">other_remark,</if>
  120. <if test="directExpense != null">direct_expense,</if>
  121. <if test="totalBudget != null">total_budget,</if>
  122. <if test="compiler != null">compiler,</if>
  123. <if test="manager != null">manager,</if>
  124. <if test="auditor != null">auditor,</if>
  125. <if test="approver != null">approver,</if>
  126. <if test="managerTime != null">manager_time,</if>
  127. <if test="zjlTime != null">zjl_time,</if>
  128. <if test="dszTime != null">dsz_time,</if>
  129. <if test="managerComment != null">manager_comment,</if>
  130. <if test="zjlComment != null">zjl_comment,</if>
  131. <if test="dszComment != null">dsz_comment,</if>
  132. <if test="remark != null">remark,</if>
  133. create_time
  134. </trim>
  135. <trim prefix="values (" suffix=")" suffixOverrides=",">
  136. <if test="budgetId != null">#{budgetId},</if>
  137. <if test="projectId != null">#{projectId},</if>
  138. <if test="staffCost != null">#{staffCost},</if>
  139. <if test="carCost != null">#{carCost},</if>
  140. <if test="deviceCost != null">#{deviceCost},</if>
  141. <if test="fixCost != null">#{fixCost},</if>
  142. <if test="settleExpense != null">#{settleExpense},</if>
  143. <if test="outExpense != null">#{outExpense},</if>
  144. <if test="businessExpense != null">#{businessExpense},</if>
  145. <if test="taxExpense != null">#{taxExpense},</if>
  146. <if test="rentExpense != null">#{rentExpense},</if>
  147. <if test="otherExpense != null">#{otherExpense},</if>
  148. <if test="outRemark != null">#{outRemark},</if>
  149. <if test="businessRemark != null">#{businessRemark},</if>
  150. <if test="taxRemark != null">#{taxRemark},</if>
  151. <if test="rentRemark != null">#{rentRemark},</if>
  152. <if test="otherRemark != null">#{otherRemark},</if>
  153. <if test="directExpense != null">#{directExpense},</if>
  154. <if test="totalBudget != null">#{totalBudget},</if>
  155. <if test="compiler != null">#{compiler},</if>
  156. <if test="manager != null">#{manager},</if>
  157. <if test="auditor != null">#{auditor},</if>
  158. <if test="approver != null">#{approver},</if>
  159. <if test="managerTime != null">#{managerTime},</if>
  160. <if test="zjlTime != null">#{zjlTime},</if>
  161. <if test="dszTime != null">#{dszTime},</if>
  162. <if test="managerComment != null">#{managerComment},</if>
  163. <if test="zjlComment != null">#{zjlComment},</if>
  164. <if test="dszComment != null">#{dszComment},</if>
  165. <if test="remark != null">#{remark},</if>
  166. sysdate()
  167. </trim>
  168. </insert>
  169. <update id="updateCmcBudget" parameterType="CmcBudget">
  170. update cmc_budget
  171. <trim prefix="SET" suffixOverrides=",">
  172. <if test="projectId != null">project_id = #{projectId},</if>
  173. <if test="staffCost != null">staff_cost = #{staffCost},</if>
  174. <if test="carCost != null">car_cost = #{carCost},</if>
  175. <if test="deviceCost != null">device_cost = #{deviceCost},</if>
  176. <if test="fixCost != null">fix_cost = #{fixCost},</if>
  177. <if test="settleExpense != null">settle_expense = #{settleExpense},</if>
  178. <if test="outExpense != null">out_expense = #{outExpense},</if>
  179. <if test="businessExpense != null">business_expense = #{businessExpense},</if>
  180. <if test="taxExpense != null">tax_expense = #{taxExpense},</if>
  181. <if test="rentExpense != null">rent_expense = #{rentExpense},</if>
  182. <if test="otherExpense != null">other_expense = #{otherExpense},</if>
  183. <if test="outRemark != null">out_remark = #{outRemark},</if>
  184. <if test="businessRemark != null">business_remark = #{businessRemark},</if>
  185. <if test="taxRemark != null">tax_remark = #{taxRemark},</if>
  186. <if test="rentRemark != null">rent_remark = #{rentRemark},</if>
  187. <if test="otherRemark != null">other_remark = #{otherRemark},</if>
  188. <if test="directExpense != null">direct_expense = #{directExpense},</if>
  189. <if test="totalBudget != null">total_budget = #{totalBudget},</if>
  190. <if test="compiler != null">compiler = #{compiler},</if>
  191. <if test="manager != null">manager = #{manager},</if>
  192. <if test="auditor != null">auditor = #{auditor},</if>
  193. <if test="approver != null">approver = #{approver},</if>
  194. <if test="managerTime != null">manager_time = #{managerTime},</if>
  195. <if test="zjlTime != null">zjl_time = #{zjlTime},</if>
  196. <if test="dszTime != null">dsz_time = #{dszTime},</if>
  197. <if test="managerComment != null">manager_comment = #{managerComment},</if>
  198. <if test="zjlComment != null">zjl_comment = #{zjlComment},</if>
  199. <if test="dszComment != null">dsz_comment = #{dszComment},</if>
  200. <if test="createTime != null">create_time = #{createTime},</if>
  201. <if test="remark != null">remark = #{remark},</if>
  202. </trim>
  203. where budget_id = #{budgetId}
  204. </update>
  205. <delete id="deleteCmcBudgetByBudgetId" parameterType="String">
  206. delete from cmc_budget where budget_id = #{budgetId}
  207. </delete>
  208. <delete id="deleteCmcBudgetByBudgetIds" parameterType="String">
  209. delete from cmc_budget where budget_id in
  210. <foreach item="budgetId" collection="array" open="(" separator="," close=")">
  211. #{budgetId}
  212. </foreach>
  213. </delete>
  214. </mapper>