123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.oa.mapper.CmcBudgetMapper">
-
- <resultMap type="CmcBudget" id="CmcBudgetResult">
- <result property="budgetId" column="budget_id" />
- <result property="projectId" column="project_id" />
- <result property="staffCost" column="staff_cost" />
- <result property="carCost" column="car_cost" />
- <result property="deviceCost" column="device_cost" />
- <result property="fixCost" column="fix_cost" />
- <result property="settleExpense" column="settle_expense" />
- <result property="outExpense" column="out_expense" />
- <result property="businessExpense" column="business_expense" />
- <result property="taxExpense" column="tax_expense" />
- <result property="rentExpense" column="rent_expense" />
- <result property="otherExpense" column="other_expense" />
- <result property="outRemark" column="out_remark" />
- <result property="businessRemark" column="business_remark" />
- <result property="taxRemark" column="tax_remark" />
- <result property="rentRemark" column="rent_remark" />
- <result property="otherRemark" column="other_remark" />
- <result property="directExpense" column="direct_expense" />
- <result property="totalBudget" column="total_budget" />
- <result property="compiler" column="compiler" />
- <result property="manager" column="manager" />
- <result property="auditor" column="auditor" />
- <result property="approver" column="approver" />
- <result property="managerComment" column="manager_comment" />
- <result property="zjlComment" column="zjl_comment" />
- <result property="dszComment" column="dsz_comment" />
- <result property="managerTime" column="manager_time" />
- <result property="zjlTime" column="zjl_time" />
- <result property="dszTime" column="dsz_time" />
- <result property="createTime" column="create_time" />
- <result property="remark" column="remark" />
- <association property="compilerUser" javaType="SysUser" resultMap="CompilerResult" />
- <association property="managerUser" javaType="SysUser" resultMap="ManagerResult" />
- <association property="zjlUser" javaType="SysUser" resultMap="ZjlResult" />
- <association property="dszUser" javaType="SysUser" resultMap="DszResult" />
- <association property="project" javaType="CmcProject" resultMap="CmcProjectResult" />
- </resultMap>
-
- <resultMap type="SysUser" id="CompilerResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="compiler_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="ManagerResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="manager_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="ZjlResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="zjl_nick_name" />
- </resultMap>
-
- <resultMap type="SysUser" id="DszResult">
- <result property="userId" column="user_id" />
- <result property="nickName" column="dsz_nick_name" />
- </resultMap>
-
- <resultMap type="CmcProject" id="CmcProjectResult">
- <result property="projectId" column="project_id" />
- <result property="projectNumber" column="project_number" />
- <result property="projectName" column="project_name" />
- </resultMap>
-
- <sql id="selectCmcBudgetVo">
- 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,
- 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,
- 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,
- b.manager_comment, b.zjl_comment, b.dsz_comment, b.remark from cmc_budget as b
- left join sys_user as u on u.user_id = b.compiler
- left join sys_user as u1 on u1.user_id = b.manager
- left join sys_user as u2 on u2.user_id = b.auditor
- left join sys_user as u3 on u3.user_id = b.approver
- left join cmc_project as p on b.project_id = p.project_id
- </sql>
-
- <select id="selectCmcBudgetList" parameterType="CmcBudget" resultMap="CmcBudgetResult">
- <include refid="selectCmcBudgetVo"/>
- <where>
- <if test="projectId != null and projectId != ''"> and b.project_id = #{projectId}</if>
- <if test="staffCost != null "> and b.staff_cost = #{staffCost}</if>
- <if test="carCost != null "> and b.car_cost = #{carCost}</if>
- <if test="deviceCost != null "> and b.device_cost = #{deviceCost}</if>
- <if test="fixCost != null "> and b.fix_cost = #{fixCost}</if>
- <if test="settleExpense != null "> and b.settle_expense = #{settleExpense}</if>
- <if test="outExpense != null "> and b.out_expense = #{outExpense}</if>
- <if test="businessExpense != null "> and b.business_expense = #{businessExpense}</if>
- <if test="rentExpense != null "> and b.rent_expense = #{rentExpense}</if>
- <if test="otherExpense != null "> and b.other_expense = #{otherExpense}</if>
- <if test="directExpense != null "> and b.direct_expense = #{directExpense}</if>
- <if test="totalBudget != null "> and b.total_budget = #{totalBudget}</if>
- <if test="compiler != null "> and b.compiler = #{compiler}</if>
- <if test="auditor != null "> and b.auditor = #{auditor}</if>
- </where>
- order by b.create_time desc
- </select>
-
- <select id="selectCmcBudgetByBudgetId" parameterType="String" resultMap="CmcBudgetResult">
- <include refid="selectCmcBudgetVo"/>
- where budget_id = #{budgetId}
- </select>
-
- <insert id="insertCmcBudget" parameterType="CmcBudget">
- insert into cmc_budget
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="budgetId != null">budget_id,</if>
- <if test="projectId != null">project_id,</if>
- <if test="staffCost != null">staff_cost,</if>
- <if test="carCost != null">car_cost,</if>
- <if test="deviceCost != null">device_cost,</if>
- <if test="fixCost != null">fix_cost,</if>
- <if test="settleExpense != null">settle_expense,</if>
- <if test="outExpense != null">out_expense,</if>
- <if test="businessExpense != null">business_expense,</if>
- <if test="taxExpense != null">tax_expense,</if>
- <if test="rentExpense != null">rent_expense,</if>
- <if test="otherExpense != null">other_expense,</if>
- <if test="outRemark != null">out_remark,</if>
- <if test="businessRemark != null">business_remark,</if>
- <if test="taxRemark != null">tax_remark,</if>
- <if test="rentRemark != null">rent_remark,</if>
- <if test="otherRemark != null">other_remark,</if>
- <if test="directExpense != null">direct_expense,</if>
- <if test="totalBudget != null">total_budget,</if>
- <if test="compiler != null">compiler,</if>
- <if test="manager != null">manager,</if>
- <if test="auditor != null">auditor,</if>
- <if test="approver != null">approver,</if>
- <if test="managerTime != null">manager_time,</if>
- <if test="zjlTime != null">zjl_time,</if>
- <if test="dszTime != null">dsz_time,</if>
- <if test="managerComment != null">manager_comment,</if>
- <if test="zjlComment != null">zjl_comment,</if>
- <if test="dszComment != null">dsz_comment,</if>
- <if test="remark != null">remark,</if>
- create_time
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="budgetId != null">#{budgetId},</if>
- <if test="projectId != null">#{projectId},</if>
- <if test="staffCost != null">#{staffCost},</if>
- <if test="carCost != null">#{carCost},</if>
- <if test="deviceCost != null">#{deviceCost},</if>
- <if test="fixCost != null">#{fixCost},</if>
- <if test="settleExpense != null">#{settleExpense},</if>
- <if test="outExpense != null">#{outExpense},</if>
- <if test="businessExpense != null">#{businessExpense},</if>
- <if test="taxExpense != null">#{taxExpense},</if>
- <if test="rentExpense != null">#{rentExpense},</if>
- <if test="otherExpense != null">#{otherExpense},</if>
- <if test="outRemark != null">#{outRemark},</if>
- <if test="businessRemark != null">#{businessRemark},</if>
- <if test="taxRemark != null">#{taxRemark},</if>
- <if test="rentRemark != null">#{rentRemark},</if>
- <if test="otherRemark != null">#{otherRemark},</if>
- <if test="directExpense != null">#{directExpense},</if>
- <if test="totalBudget != null">#{totalBudget},</if>
- <if test="compiler != null">#{compiler},</if>
- <if test="manager != null">#{manager},</if>
- <if test="auditor != null">#{auditor},</if>
- <if test="approver != null">#{approver},</if>
- <if test="managerTime != null">#{managerTime},</if>
- <if test="zjlTime != null">#{zjlTime},</if>
- <if test="dszTime != null">#{dszTime},</if>
- <if test="managerComment != null">#{managerComment},</if>
- <if test="zjlComment != null">#{zjlComment},</if>
- <if test="dszComment != null">#{dszComment},</if>
- <if test="remark != null">#{remark},</if>
- sysdate()
- </trim>
- </insert>
-
- <update id="updateCmcBudget" parameterType="CmcBudget">
- update cmc_budget
- <trim prefix="SET" suffixOverrides=",">
- <if test="projectId != null">project_id = #{projectId},</if>
- <if test="staffCost != null">staff_cost = #{staffCost},</if>
- <if test="carCost != null">car_cost = #{carCost},</if>
- <if test="deviceCost != null">device_cost = #{deviceCost},</if>
- <if test="fixCost != null">fix_cost = #{fixCost},</if>
- <if test="settleExpense != null">settle_expense = #{settleExpense},</if>
- <if test="outExpense != null">out_expense = #{outExpense},</if>
- <if test="businessExpense != null">business_expense = #{businessExpense},</if>
- <if test="taxExpense != null">tax_expense = #{taxExpense},</if>
- <if test="rentExpense != null">rent_expense = #{rentExpense},</if>
- <if test="otherExpense != null">other_expense = #{otherExpense},</if>
- <if test="outRemark != null">out_remark = #{outRemark},</if>
- <if test="businessRemark != null">business_remark = #{businessRemark},</if>
- <if test="taxRemark != null">tax_remark = #{taxRemark},</if>
- <if test="rentRemark != null">rent_remark = #{rentRemark},</if>
- <if test="otherRemark != null">other_remark = #{otherRemark},</if>
- <if test="directExpense != null">direct_expense = #{directExpense},</if>
- <if test="totalBudget != null">total_budget = #{totalBudget},</if>
- <if test="compiler != null">compiler = #{compiler},</if>
- <if test="manager != null">manager = #{manager},</if>
- <if test="auditor != null">auditor = #{auditor},</if>
- <if test="approver != null">approver = #{approver},</if>
- <if test="managerTime != null">manager_time = #{managerTime},</if>
- <if test="zjlTime != null">zjl_time = #{zjlTime},</if>
- <if test="dszTime != null">dsz_time = #{dszTime},</if>
- <if test="managerComment != null">manager_comment = #{managerComment},</if>
- <if test="zjlComment != null">zjl_comment = #{zjlComment},</if>
- <if test="dszComment != null">dsz_comment = #{dszComment},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where budget_id = #{budgetId}
- </update>
-
- <delete id="deleteCmcBudgetByBudgetId" parameterType="String">
- delete from cmc_budget where budget_id = #{budgetId}
- </delete>
-
- <delete id="deleteCmcBudgetByBudgetIds" parameterType="String">
- delete from cmc_budget where budget_id in
- <foreach item="budgetId" collection="array" open="(" separator="," close=")">
- #{budgetId}
- </foreach>
- </delete>
- </mapper>
|