123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?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.CmcBudgetSettleMapper">
-
- <resultMap type="CmcBudgetSettle" id="CmcBudgetSettleResult">
- <result property="budgetSettleId" column="budget_settle_id" />
- <result property="budgetId" column="budget_id" />
- <result property="priceId" column="price_id" />
- <result property="workload" column="workload" />
- <result property="coefficient" column="coefficient" />
- <result property="groundType" column="ground_type" />
- <result property="settle" column="settle" />
- <association property="cmcPrice" javaType="CmcPrice" resultMap="CmcPriceResult" />
- </resultMap>
-
- <resultMap type="CmcPrice" id="CmcPriceResult">
- <result property="id" column="id" />
- <result property="workType" column="work_type" />
- <result property="workItem" column="work_item" />
- <result property="subItem" column="sub_item" />
- <result property="scaleGrade" column="scale_grade" />
- <result property="unit" column="unit" />
- <result property="commonPrice" column="common_price" />
- <result property="complexPrice" column="complex_price" />
- </resultMap>
-
- <sql id="selectCmcBudgetSettleVo">
- select bs.budget_settle_id, bs.budget_id, bs.price_id, p.work_type, p.work_item, p.sub_item, p.scale_grade, p.unit, p.common_price, p.complex_price, bs.workload, bs.coefficient, bs.ground_type, bs.settle from cmc_budget_settle as bs
- left join cmc_price as p on p.id = bs.price_id
- </sql>
-
- <select id="selectCmcBudgetSettleList" parameterType="CmcBudgetSettle" resultMap="CmcBudgetSettleResult">
- <include refid="selectCmcBudgetSettleVo"/>
- <where>
- <if test="budgetId != null and budgetId != ''"> and bs.budget_id = #{budgetId}</if>
- <if test="priceId != null "> and bs.price_id = #{priceId}</if>
- <if test="workload != null "> and bs.workload = #{workload}</if>
- <if test="coefficient != null "> and bs.coefficient = #{coefficient}</if>
- <if test="groundType != null and groundType != ''"> and bs.ground_type = #{groundType}</if>
- <if test="settle != null "> and bs.settle = #{settle}</if>
- </where>
- </select>
-
- <select id="selectCmcBudgetSettleByBudgetId" parameterType="String" resultMap="CmcBudgetSettleResult">
- <include refid="selectCmcBudgetSettleVo"/>
- where bs.budget_id = #{budgetId}
- </select>
-
- <insert id="insertCmcBudgetSettle" parameterType="CmcBudgetSettle">
- insert into cmc_budget_settle
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="budgetSettleId != null">budget_settle_id,</if>
- <if test="budgetId != null">budget_id,</if>
- <if test="priceId != null">price_id,</if>
- <if test="workload != null">workload,</if>
- <if test="coefficient != null">coefficient,</if>
- <if test="groundType != null">ground_type,</if>
- <if test="settle != null">settle,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="budgetSettleId != null">#{budgetSettleId},</if>
- <if test="budgetId != null">#{budgetId},</if>
- <if test="priceId != null">#{priceId},</if>
- <if test="workload != null">#{workload},</if>
- <if test="coefficient != null">#{coefficient},</if>
- <if test="groundType != null">#{groundType},</if>
- <if test="settle != null">#{settle},</if>
- </trim>
- </insert>
-
- <update id="updateCmcBudgetSettle" parameterType="CmcBudgetSettle">
- update cmc_budget_settle
- <trim prefix="SET" suffixOverrides=",">
- <if test="budgetId != null">budget_id = #{budgetId},</if>
- <if test="priceId != null">price_id = #{priceId},</if>
- <if test="workload != null">workload = #{workload},</if>
- <if test="coefficient != null">coefficient = #{coefficient},</if>
- <if test="groundType != null">ground_type = #{groundType},</if>
- <if test="settle != null">settle = #{settle},</if>
- </trim>
- where budget_settle_id = #{budgetSettleId}
- </update>
-
- <delete id="deleteCmcBudgetSettleByBudgetSettleId" parameterType="String">
- delete from cmc_budget_settle where budget_settle_id = #{budgetSettleId}
- </delete>
-
- <delete id="deleteCmcBudgetSettleByBudgetSettleIds" parameterType="String">
- delete from cmc_budget_settle where budget_settle_id in
- <foreach item="budgetSettleId" collection="array" open="(" separator="," close=")">
- #{budgetSettleId}
- </foreach>
- </delete>
- </mapper>
|