郑永安
2023-06-19 2fcd97552d16718cc7997629fd637a73a5a4483f
src/main/java/com/gk/firework/Mapper/mybatis/ContractOrderInfoMapper.xml
对比新文件
@@ -0,0 +1,275 @@
<?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.ContractOrderInfoMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.ContractOrderInfo" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="ordercode" property="ordercode" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="VARCHAR" />
    <result column="returnstatus" property="returnstatus" jdbcType="VARCHAR" />
    <result column="operator" property="operator" jdbcType="VARCHAR" />
    <result column="manufacturer" property="manufacturer" jdbcType="VARCHAR" />
    <result column="origincontract" property="origincontract" jdbcType="VARCHAR" />
    <result column="confirmcontract" property="confirmcontract" jdbcType="VARCHAR" />
    <result column="createdby" property="createdby" jdbcType="VARCHAR" />
    <result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
    <result column="modifiedby" property="modifiedby" jdbcType="VARCHAR" />
    <result column="modifieddate" property="modifieddate" jdbcType="TIMESTAMP" />
    <result column="producedate" property="producedate" jdbcType="TIMESTAMP" />
    <result column="isdel" property="isdel" jdbcType="TINYINT" />
    <result column="comments" property="comments" jdbcType="VARCHAR" />
    <result column="opinion" property="opinion" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, ordercode, status,returnstatus, operator, manufacturer, origincontract, confirmcontract, createdby,
    createddate, modifiedby, modifieddate, producedate, isdel, comments, opinion
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--          -->
    select
    <include refid="Base_Column_List" />
    from contractorder
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectDataGrid" resultType="com.gk.firework.Domain.Vo.ContractOrderVo">
    select
    contractorder.*
    from contractorder
    LEFT JOIN `user` ON `user`.companynumber = contractorder.purchaseenterprisenumber
    <where>
      1=1
      AND contractorder.isdel = 0
      AND `user`.isdel = 0
      AND `user`.issale = 0
      <if test="condition.supplyunitname != null and condition.supplyunitname!=''">
        and contractorder.supplyunitname LIKE CONCAT('%',#{condition.supplyunitname},'%')
      </if>
      <if test="condition.supplyenterprisenumber != null and condition.supplyenterprisenumber != ''">
        and contractorder.supplyenterprisenumber = #{condition.supplyenterprisenumber}
      </if>
      <if test="condition.purchaseunitname != null and condition.purchaseunitname != ''">
        and contractorder.purchaseunitname LIKE CONCAT('%',#{condition.purchaseunitname},'%')
      </if>
      <if test="condition.operator != null and condition.operator != ''">
        and contractorder.operator LIKE CONCAT('%',#{condition.operator},'%')
      </if>
      <if test="condition.purchaseenterprisenumber != null and condition.purchaseenterprisenumber != ''">
        and contractorder.purchaseenterprisenumber = #{condition.purchaseenterprisenumber}
      </if>
      <if test="condition.ordercode != null and condition.ordercode!=''">
        and contractorder.ordercode = #{condition.ordercode}
      </if>
      <if test="condition.status != null and condition.status!=''">
        and contractorder.status = #{condition.status}
      </if>
      <if test="condition.province != null and condition.province != ''">
        and `user`.province = #{condition.province}
      </if>
      <if test="condition.city != null and condition.city != ''">
        and `user`.city = #{condition.city}
      </if>
      <if test="condition.area != null and condition.area != ''">
        and `user`.area = #{condition.area}
      </if>
      <if test="condition.town != null and condition.town != ''">
        and `user`.town = #{condition.town}
      </if>
      <if test="condition.community != null and condition.community != ''">
        and `user`.community = #{condition.community}
      </if>
      <if test="condition.confirm != null and condition.confirm == 1">
        and contractorder.status != '待提交'
      </if>
    </where>
  </select>
  <select id="selectByStatus" resultType="com.gk.firework.Domain.ContractOrderInfo">
      select
      <include refid="Base_Column_List" />
      from contractorder
      where isdel = 0
      and status = #{status}
      and producedate &lt;= #{now}
  </select>
  <select id="selectByOrderCode" resultType="com.gk.firework.Domain.ContractOrderInfo">
    select
    <include refid="Base_Column_List" />
    from contractorder
    where isdel = 0
    and ordercode = #{ordercode}
  </select>
    <select id="selectCountToday" resultType="java.lang.Integer">
      select
      count(0)
      from contractorder as contractorder
      where contractorder.isdel = 0
      and TO_DAYS(contractorder.createddate) = TO_DAYS(NOW())
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--          -->
    delete from contractorder
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insertSelective" parameterType="com.gk.firework.Domain.ContractOrderInfo" >
    <!--          -->
    insert into contractorder
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="ordercode != null" >
        ordercode,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="operator != null" >
        operator,
      </if>
      <if test="manufacturer != null" >
        manufacturer,
      </if>
      <if test="origincontract != null" >
        origincontract,
      </if>
      <if test="confirmcontract != null" >
        confirmcontract,
      </if>
      <if test="createdby != null" >
        createdby,
      </if>
      <if test="createddate != null" >
        createddate,
      </if>
      <if test="modifiedby != null" >
        modifiedby,
      </if>
      <if test="modifieddate != null" >
        modifieddate,
      </if>
      <if test="isdel != null">
        isdel,
      </if>
      <if test="comments != null">
        comments,
      </if>
      <if test="opinion != null">
        opinion,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="ordercode != null" >
        #{ordercode,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="operator != null" >
        #{operator,jdbcType=VARCHAR},
      </if>
      <if test="manufacturer != null" >
        #{manufacturer,jdbcType=VARCHAR},
      </if>
      <if test="origincontract != null" >
        #{origincontract,jdbcType=VARCHAR},
      </if>
      <if test="confirmcontract != null" >
        #{confirmcontract,jdbcType=VARCHAR},
      </if>
      <if test="createdby != null" >
        #{createdby,jdbcType=VARCHAR},
      </if>
      <if test="createddate != null" >
        #{createddate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifiedby != null" >
        #{modifiedby,jdbcType=VARCHAR},
      </if>
      <if test="modifieddate != null" >
        #{modifieddate,jdbcType=TIMESTAMP},
      </if>
      <if test="isdel != null">
        #{isdel,jdbcType=TINYINT},
      </if>
      <if test="comments != null">
        #{comments,jdbcType=VARCHAR},
      </if>
      <if test="opinion != null">
        #{opinion,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.ContractOrderInfo" >
    <!--          -->
    update contractorder
    <set >
      <if test="ordercode != null" >
        ordercode = #{ordercode,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="operator != null" >
        operator = #{operator,jdbcType=VARCHAR},
      </if>
      <if test="manufacturer != null" >
        manufacturer = #{manufacturer,jdbcType=VARCHAR},
      </if>
      <if test="origincontract != null" >
        origincontract = #{origincontract,jdbcType=VARCHAR},
      </if>
      <if test="confirmcontract != null" >
        confirmcontract = #{confirmcontract,jdbcType=VARCHAR},
      </if>
      <if test="createdby != null" >
        createdby = #{createdby,jdbcType=VARCHAR},
      </if>
      <if test="createddate != null" >
        createddate = #{createddate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifiedby != null" >
        modifiedby = #{modifiedby,jdbcType=VARCHAR},
      </if>
      <if test="modifieddate != null" >
        modifieddate = #{modifieddate,jdbcType=TIMESTAMP},
      </if>
      <if test="isdel != null">
        isdel = #{isdel,jdbcType=TINYINT},
      </if>
      <if test="comments != null">
        comments = #{comments,jdbcType=VARCHAR},
      </if>
      <if test="opinion != null">
        opinion = #{opinion,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.ContractOrderInfo" >
    <!--          -->
    update contractorder
    set ordercode = #{ordercode,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      operator = #{operator,jdbcType=VARCHAR},
      manufacturer = #{manufacturer,jdbcType=VARCHAR},
      origincontract = #{origincontract,jdbcType=VARCHAR},
      confirmcontract = #{confirmcontract,jdbcType=VARCHAR},
      createdby = #{createdby,jdbcType=VARCHAR},
      createddate = #{createddate,jdbcType=TIMESTAMP},
      modifiedby = #{modifiedby,jdbcType=VARCHAR},
      modifieddate = #{modifieddate,jdbcType=TIMESTAMP},
      isdel = #{isdel,jdbcType=TINYINT},
      comments = #{comments,jdbcType=VARCHAR},
      opinion = #{opinion,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
    <update id="updateReturnStatus">
      update contractorder
      set returnstatus = #{returnstatus}
      where ordercode = #{ordercode}
    </update>
</mapper>