From 59e91a4e9ddaf23cebb12993c774aa899ab22d16 Mon Sep 17 00:00:00 2001
From: 郑永安 <zyazyz250@sina.com>
Date: Mon, 19 Jun 2023 14:22:45 +0800
Subject: [PATCH] 描述
---
src/main/java/com/gk/firework/Mapper/mybatis/ContractDetailInfoMapper.xml | 99 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 99 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/gk/firework/Mapper/mybatis/ContractDetailInfoMapper.xml b/src/main/java/com/gk/firework/Mapper/mybatis/ContractDetailInfoMapper.xml
new file mode 100644
index 0000000..0606d5e
--- /dev/null
+++ b/src/main/java/com/gk/firework/Mapper/mybatis/ContractDetailInfoMapper.xml
@@ -0,0 +1,99 @@
+<?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.gk.firework.Mapper.ContractDetailInfoMapper" >
+ <resultMap id="BaseResultMap" type="com.gk.firework.Domain.ContractDetailInfo" >
+ <!-- -->
+ <id column="id" property="id" jdbcType="BIGINT" />
+ <result column="ordercode" property="ordercode" jdbcType="VARCHAR" />
+ <result column="directioncode" property="directioncode" jdbcType="VARCHAR" />
+ <result column="name" property="name" jdbcType="VARCHAR" />
+ <result column="num" property="num" jdbcType="INTEGER" />
+ </resultMap>
+ <sql id="Base_Column_List" >
+ <!-- -->
+ id, ordercode, directioncode, name, num
+ </sql>
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+ <!-- -->
+ select
+ <include refid="Base_Column_List" />
+ from contractdetail
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+ <select id="selectByOrder" resultType="com.gk.firework.Domain.Vo.ProductVo">
+ SELECT
+ contractdetail.id,
+ contractdetail.directioncode,
+ contractdetail.num,
+ contractdetail.price,
+ contractdetail.changenum,
+ product.`name`,
+ product.purchaseprice,
+ product.saleprice,
+ product.specification,
+ product.explosivecontent,
+ product.type,
+ product.`level`,
+ product.productdate,
+ product.boxnumber,
+ product.packing,
+ product.manufacturer
+ FROM
+ contractdetail
+ LEFT JOIN product on product.directioncode = contractdetail.directioncode and product.isdel = 0
+ where
+ contractdetail.ordercode = #{ordercode}
+ </select>
+ <select id="selectAllDetailAtSpecificDate" resultType="com.gk.firework.Domain.ContractDetailInfo">
+ select detail.*
+ from contractorder as co
+ left join contractdetail as detail on detail.ordercode = co.ordercode
+ where
+ detail.directioncode = #{productCode}
+ and DATE(co.producedate) = DATE(#{producedate})
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+ <!-- -->
+ delete from contractdetail
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <delete id="deleteByOrder">
+ delete from contractdetail
+ where ordercode = #{ordercode}
+ </delete>
+ <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.ContractDetailInfo" >
+ <!-- -->
+ update contractdetail
+ <set >
+ <if test="ordercode != null" >
+ ordercode = #{ordercode,jdbcType=VARCHAR},
+ </if>
+ <if test="directioncode != null" >
+ directioncode = #{directioncode,jdbcType=VARCHAR},
+ </if>
+ <if test="name != null" >
+ name = #{name,jdbcType=VARCHAR},
+ </if>
+ <if test="num != null" >
+ num = #{num,jdbcType=INTEGER},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.ContractDetailInfo" >
+ <!-- -->
+ update contractdetail
+ set ordercode = #{ordercode,jdbcType=VARCHAR},
+ directioncode = #{directioncode,jdbcType=VARCHAR},
+ name = #{name,jdbcType=VARCHAR},
+ num = #{num,jdbcType=INTEGER}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateChangNum">
+ update contractdetail
+ set changenum = changenum + #{returnNum}
+ where ordercode = #{ordercode}
+ and directioncode = #{productCode}
+
+ </update>
+</mapper>
--
Gitblit v1.9.2