110 lines
5.6 KiB
XML
110 lines
5.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.ruoyi.cost.mapper.CostProdDetailMapper">
|
||
|
|
|
||
|
|
<resultMap type="CostProdDetail" id="CostProdDetailResult">
|
||
|
|
<result property="detailId" column="detail_id" />
|
||
|
|
<result property="reportId" column="report_id" />
|
||
|
|
<result property="shift" column="shift" />
|
||
|
|
<result property="detailDate" column="detail_date" />
|
||
|
|
<result property="itemId" column="item_id" />
|
||
|
|
<result property="quantity" column="quantity" />
|
||
|
|
<result property="unitPrice" column="unit_price" />
|
||
|
|
<result property="amount" column="amount" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
<result property="delFlag" column="del_flag" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateBy" column="update_by" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectCostProdDetailVo">
|
||
|
|
select detail_id, report_id, shift, detail_date, item_id, quantity, unit_price, amount, remark, del_flag, create_by, create_time, update_by, update_time from cost_prod_detail
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectCostProdDetailList" parameterType="CostProdDetail" resultMap="CostProdDetailResult">
|
||
|
|
<include refid="selectCostProdDetailVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="reportId != null "> and report_id = #{reportId}</if>
|
||
|
|
<if test="shift != null and shift != ''"> and shift = #{shift}</if>
|
||
|
|
<if test="detailDate != null "> and detail_date = #{detailDate}</if>
|
||
|
|
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||
|
|
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||
|
|
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||
|
|
<if test="amount != null "> and amount = #{amount}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectCostProdDetailByDetailId" parameterType="Long" resultMap="CostProdDetailResult">
|
||
|
|
<include refid="selectCostProdDetailVo"/>
|
||
|
|
where detail_id = #{detailId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertCostProdDetail" parameterType="CostProdDetail" useGeneratedKeys="true" keyProperty="detailId">
|
||
|
|
insert into cost_prod_detail
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="reportId != null">report_id,</if>
|
||
|
|
<if test="shift != null">shift,</if>
|
||
|
|
<if test="detailDate != null">detail_date,</if>
|
||
|
|
<if test="itemId != null">item_id,</if>
|
||
|
|
<if test="quantity != null">quantity,</if>
|
||
|
|
<if test="unitPrice != null">unit_price,</if>
|
||
|
|
<if test="amount != null">amount,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
<if test="delFlag != null">del_flag,</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>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="reportId != null">#{reportId},</if>
|
||
|
|
<if test="shift != null">#{shift},</if>
|
||
|
|
<if test="detailDate != null">#{detailDate},</if>
|
||
|
|
<if test="itemId != null">#{itemId},</if>
|
||
|
|
<if test="quantity != null">#{quantity},</if>
|
||
|
|
<if test="unitPrice != null">#{unitPrice},</if>
|
||
|
|
<if test="amount != null">#{amount},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
<if test="delFlag != null">#{delFlag},</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>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateCostProdDetail" parameterType="CostProdDetail">
|
||
|
|
update cost_prod_detail
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="reportId != null">report_id = #{reportId},</if>
|
||
|
|
<if test="shift != null">shift = #{shift},</if>
|
||
|
|
<if test="detailDate != null">detail_date = #{detailDate},</if>
|
||
|
|
<if test="itemId != null">item_id = #{itemId},</if>
|
||
|
|
<if test="quantity != null">quantity = #{quantity},</if>
|
||
|
|
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||
|
|
<if test="amount != null">amount = #{amount},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
<if test="delFlag != null">del_flag = #{delFlag},</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>
|
||
|
|
</trim>
|
||
|
|
where detail_id = #{detailId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteCostProdDetailByDetailId" parameterType="Long">
|
||
|
|
delete from cost_prod_detail where detail_id = #{detailId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteCostProdDetailByDetailIds" parameterType="String">
|
||
|
|
delete from cost_prod_detail where detail_id in
|
||
|
|
<foreach item="detailId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{detailId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|