91 lines
4.6 KiB
XML
91 lines
4.6 KiB
XML
|
|
<?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.bonus.sgzb.material.mapper.PlanBorrowInfoMapper">
|
||
|
|
|
||
|
|
<resultMap type="com.bonus.sgzb.material.domain.PlanBorrowInfo" id="PlanBorrowInfoResult">
|
||
|
|
<result property="borrowId" column="borrow_id" />
|
||
|
|
<result property="needUnitId" column="need_unit_id" />
|
||
|
|
<result property="borrowUnitId" column="borrow_unit_id" />
|
||
|
|
<result property="code" column="code" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateBy" column="update_by" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
<result property="companyId" column="company_id" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectPlanBorrowInfoVo">
|
||
|
|
select borrow_id, need_unit_id, borrow_unit_id, code, create_by, create_time, update_by, update_time, remark, company_id from plan_borrow_info
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectPlanBorrowInfoList" parameterType="com.bonus.sgzb.material.domain.PlanBorrowInfo" resultMap="PlanBorrowInfoResult">
|
||
|
|
<include refid="selectPlanBorrowInfoVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="needUnitId != null "> and need_unit_id = #{needUnitId}</if>
|
||
|
|
<if test="borrowUnitId != null "> and borrow_unit_id = #{borrowUnitId}</if>
|
||
|
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
||
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectPlanBorrowInfoByBorrowId" parameterType="Long" resultMap="PlanBorrowInfoResult">
|
||
|
|
<include refid="selectPlanBorrowInfoVo"/>
|
||
|
|
where borrow_id = #{borrowId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertPlanBorrowInfo" parameterType="com.bonus.sgzb.material.domain.PlanBorrowInfo" useGeneratedKeys="true" keyProperty="borrowId">
|
||
|
|
insert into plan_borrow_info
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="needUnitId != null">need_unit_id,</if>
|
||
|
|
<if test="borrowUnitId != null">borrow_unit_id,</if>
|
||
|
|
<if test="code != null">code,</if>
|
||
|
|
<if test="createBy != null">create_by,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateBy != null">update_by,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
<if test="companyId != null">company_id,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="needUnitId != null">#{needUnitId},</if>
|
||
|
|
<if test="borrowUnitId != null">#{borrowUnitId},</if>
|
||
|
|
<if test="code != null">#{code},</if>
|
||
|
|
<if test="createBy != null">#{createBy},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateBy != null">#{updateBy},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
<if test="companyId != null">#{companyId},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updatePlanBorrowInfo" parameterType="com.bonus.sgzb.material.domain.PlanBorrowInfo">
|
||
|
|
update plan_borrow_info
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="needUnitId != null">need_unit_id = #{needUnitId},</if>
|
||
|
|
<if test="borrowUnitId != null">borrow_unit_id = #{borrowUnitId},</if>
|
||
|
|
<if test="code != null">code = #{code},</if>
|
||
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
<if test="companyId != null">company_id = #{companyId},</if>
|
||
|
|
</trim>
|
||
|
|
where borrow_id = #{borrowId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deletePlanBorrowInfoByBorrowId" parameterType="Long">
|
||
|
|
delete from plan_borrow_info where borrow_id = #{borrowId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deletePlanBorrowInfoByBorrowIds" parameterType="String">
|
||
|
|
delete from plan_borrow_info where borrow_id in
|
||
|
|
<foreach item="borrowId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{borrowId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|