91 lines
4.8 KiB
XML
91 lines
4.8 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.PurchaseCheckInfoMapper">
|
||
|
|
|
||
|
|
<resultMap type="com.bonus.sgzb.material.domain.PurchaseCheckInfo" id="PurchaseCheckInfoResult">
|
||
|
|
<result property="taskId" column="task_id" />
|
||
|
|
<result property="purchaseTime" column="purchase_time" />
|
||
|
|
<result property="arrivalTime" column="arrival_time" />
|
||
|
|
<result property="purchaser" column="purchaser" />
|
||
|
|
<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="selectPurchaseCheckInfoVo">
|
||
|
|
select task_id, purchase_time, arrival_time, purchaser, create_by, create_time, update_by, update_time, remark, company_id from purchase_check_info
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectPurchaseCheckInfoList" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" resultMap="PurchaseCheckInfoResult">
|
||
|
|
<include refid="selectPurchaseCheckInfoVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="purchaseTime != null and purchaseTime != ''"> and purchase_time = #{purchaseTime}</if>
|
||
|
|
<if test="arrivalTime != null and arrivalTime != ''"> and arrival_time = #{arrivalTime}</if>
|
||
|
|
<if test="purchaser != null "> and purchaser = #{purchaser}</if>
|
||
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectPurchaseCheckInfoByTaskId" parameterType="Long" resultMap="PurchaseCheckInfoResult">
|
||
|
|
<include refid="selectPurchaseCheckInfoVo"/>
|
||
|
|
where task_id = #{taskId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertPurchaseCheckInfo" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo" useGeneratedKeys="true" keyProperty="taskId">
|
||
|
|
insert into purchase_check_info
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="purchaseTime != null and purchaseTime != ''">purchase_time,</if>
|
||
|
|
<if test="arrivalTime != null">arrival_time,</if>
|
||
|
|
<if test="purchaser != null">purchaser,</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="purchaseTime != null and purchaseTime != ''">#{purchaseTime},</if>
|
||
|
|
<if test="arrivalTime != null">#{arrivalTime},</if>
|
||
|
|
<if test="purchaser != null">#{purchaser},</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="updatePurchaseCheckInfo" parameterType="com.bonus.sgzb.material.domain.PurchaseCheckInfo">
|
||
|
|
update purchase_check_info
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="purchaseTime != null and purchaseTime != ''">purchase_time = #{purchaseTime},</if>
|
||
|
|
<if test="arrivalTime != null">arrival_time = #{arrivalTime},</if>
|
||
|
|
<if test="purchaser != null">purchaser = #{purchaser},</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 task_id = #{taskId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deletePurchaseCheckInfoByTaskId" parameterType="Long">
|
||
|
|
delete from purchase_check_info where task_id = #{taskId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deletePurchaseCheckInfoByTaskIds" parameterType="String">
|
||
|
|
delete from purchase_check_info where task_id in
|
||
|
|
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{taskId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|