123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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.CmcBorrowDetailMapper">
-
- <resultMap type="CmcBorrowDetail" id="CmcBorrowDetailResult">
- <result property="borrowDetailId" column="borrow_detail_id" />
- <result property="borrowId" column="borrow_id" />
- <result property="borrowItem" column="borrow_item" />
- <result property="unit" column="unit" />
- <result property="price" column="price" />
- <result property="quantity" column="quantity" />
- <result property="applyAmount" column="apply_amount" />
- <result property="xmAmount" column="xm_amount" />
- <result property="managerAmount" column="manager_amount" />
- </resultMap>
-
- <sql id="selectCmcBorrowDetailVo">
- select borrow_detail_id, borrow_id, borrow_item, unit, price, quantity, apply_amount, xm_amount, manager_amount from cmc_borrow_detail
- </sql>
-
- <select id="selectCmcBorrowDetailList" parameterType="CmcBorrowDetail" resultMap="CmcBorrowDetailResult">
- <include refid="selectCmcBorrowDetailVo"/>
- <where>
- <if test="borrowId != null and borrowId != ''"> and borrow_id = #{borrowId}</if>
- <if test="borrowItem != null and borrowItem != ''"> and borrow_item = #{borrowItem}</if>
- <if test="unit != null and unit != ''"> and unit = #{unit}</if>
- <if test="price != null "> and price = #{price}</if>
- <if test="quantity != null "> and quantity = #{quantity}</if>
- <if test="applyAmount != null "> and apply_amount = #{applyAmount}</if>
- <if test="xmAmount != null "> and xm_amount = #{xmAmount}</if>
- <if test="managerAmount != null "> and manager_amount = #{managerAmount}</if>
- </where>
- </select>
-
- <select id="selectCmcBorrowDetailByBorrowId" parameterType="String" resultMap="CmcBorrowDetailResult">
- <include refid="selectCmcBorrowDetailVo"/>
- where borrow_id = #{borrowId}
- </select>
-
- <insert id="insertCmcBorrowDetail" parameterType="CmcBorrowDetail">
- insert into cmc_borrow_detail
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="borrowDetailId != null">borrow_detail_id,</if>
- <if test="borrowId != null">borrow_id,</if>
- <if test="borrowItem != null">borrow_item,</if>
- <if test="unit != null">unit,</if>
- <if test="price != null">price,</if>
- <if test="quantity != null">quantity,</if>
- <if test="applyAmount != null">apply_amount,</if>
- <if test="xmAmount != null">xm_amount,</if>
- <if test="managerAmount != null">manager_amount,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="borrowDetailId != null">#{borrowDetailId},</if>
- <if test="borrowId != null">#{borrowId},</if>
- <if test="borrowItem != null">#{borrowItem},</if>
- <if test="unit != null">#{unit},</if>
- <if test="price != null">#{price},</if>
- <if test="quantity != null">#{quantity},</if>
- <if test="applyAmount != null">#{applyAmount},</if>
- <if test="xmAmount != null">#{xmAmount},</if>
- <if test="managerAmount != null">#{managerAmount},</if>
- </trim>
- </insert>
-
- <update id="updateCmcBorrowDetail" parameterType="CmcBorrowDetail">
- update cmc_borrow_detail
- <trim prefix="SET" suffixOverrides=",">
- <if test="borrowId != null">borrow_id = #{borrowId},</if>
- <if test="borrowItem != null">borrow_item = #{borrowItem},</if>
- <if test="unit != null">unit = #{unit},</if>
- <if test="price != null">price = #{price},</if>
- <if test="quantity != null">quantity = #{quantity},</if>
- <if test="applyAmount != null">apply_amount = #{applyAmount},</if>
- <if test="xmAmount != null">xm_amount = #{xmAmount},</if>
- <if test="managerAmount != null">manager_amount = #{managerAmount},</if>
- </trim>
- where borrow_detail_id = #{borrowDetailId}
- </update>
-
- <delete id="deleteCmcBorrowDetailByBorrowId" parameterType="String">
- delete from cmc_borrow_detail where borrow_id = #{borrowId}
- </delete>
-
- <delete id="deleteCmcBorrowDetailByBorrowIds" parameterType="String">
- delete from cmc_borrow_detail where borrow_id in
- <foreach item="borrowId" collection="array" open="(" separator="," close=")">
- #{borrowId}
- </foreach>
- </delete>
- </mapper>
|