张磊磊
2023-12-04 f7cb52a5b77ab202d67116f6156b472c8517203b
hd/pipe/materialsManage/src/main/resources/mapping/TMaterialReleaseMapper.xml
@@ -205,6 +205,9 @@
      <if test="inspectDate != null">
        inspect_date,
      </if>
      <if test="types != null">
        types,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="mixingId != null">
@@ -245,6 +248,9 @@
      </if>
      <if test="inspectDate != null">
        #{inspectDate,jdbcType=VARCHAR},
      </if>
      <if test="types != null">
        #{types},
      </if>
    </trim>
  </insert>
@@ -321,7 +327,7 @@
      </if>
    </trim>
  </insert>
  <insert id="mixingConsumeInTwo" parameterType="com.thhy.materials.modules.biz.concret.entity.TMixingConsume">
  <insert id="mixingConsumeInTwo" >
    insert into t_mixing_consume
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="mixingConsumeId != null">
@@ -432,5 +438,97 @@
     left join  sys_dict sd on mc.dict_id=sd.dict_id
     where mc.mixing_signboard_id=#{mixingSignboardId} and mc.star=#{star}
  </select>
  <select id="mixingConsumePull" resultType="com.thhy.materials.modules.biz.concret.entity.TMixingSignboard">
    select
     tms.mixing_signboard_id as mixingSignboardId,
     tms.signboard_name as signboardName,
     sp.pro_name as proName
     from t_mixing_signboard tms left join sys_project sp
     on tms.pro_id=sp.pro_id
  </select>
  <select id="siloPull" resultType="com.thhy.materials.modules.biz.concret.entity.TSilo">
    select silo_id as siloId,
silo_name as siloName,
types
    from t_silo
  </select>
  <update id="mixingUpdateType"  parameterType="java.lang.String">
    update t_mixing set types=2 where silo_id=#{siloId}
  </update>
  <select id="siloMixingList" resultType="com.thhy.materials.modules.biz.concret.entity.TMixing">
        SELECT
        tm.mixing_id as mixingId,
        tm.material as material,
        tm.spec as spec,
        tm.producer as producer,
        tm.stove as stove,
        tm.in_num as inNum,
        tm.in_date as inDate,
        tm.inspect_state as inspectState,
        tm.report_number as reportNumber,
        tm.stata as stata,
        tm.silo_id as siloId,
        tm.percentage as percentage,
        tm.inspect_date as inspectDate,
        ts.silo_name as siloName,
        ts.types as types
FROM
   t_silo ts
   LEFT JOIN t_mixing tm ON ts.silo_id=tm.silo_id
   where  tm.types=1
    <if test="types!=null and types!='' ">
        and ts.types=#{types}
    </if>
    <if test="stata!=null and stata!='' ">
        and tm.stata=#{stata}
    </if>
    <if test="strTime!=null and strTime!=null and endTime!=null and endTime!='' ">
      and tm.in_date between #{strTime} and #{endTime}
    </if>
  </select>
  <update id="mixingUpdate" >
    update t_mixing
    <set>
      <if test="material != null">
        material = #{material,jdbcType=VARCHAR},
      </if>
      <if test="spec != null">
        spec = #{spec,jdbcType=VARCHAR},
      </if>
      <if test="producer != null">
        producer = #{producer,jdbcType=VARCHAR},
      </if>
      <if test="stove != null">
        stove = #{stove,jdbcType=VARCHAR},
      </if>
      <if test="inNum != null">
        in_num = #{inNum,jdbcType=VARCHAR},
      </if>
      <if test="inDate != null">
        in_date = #{inDate,jdbcType=VARCHAR},
      </if>
      <if test="inspectState != null">
        inspect_state = #{inspectState,jdbcType=INTEGER},
      </if>
      <if test="reportNumber != null">
        report_number = #{reportNumber,jdbcType=VARCHAR},
      </if>
      <if test="stata != null">
        stata = #{stata},
      </if>
      <if test="siloId != null">
        silo_id = #{siloId},
      </if>
      <if test="percentage != null">
        percentage = #{percentage},
      </if>
      <if test="inspectDate != null">
        inspect_date = #{inspectDate},
      </if>
    </set>
    where mixing_id = #{mixingId,jdbcType=VARCHAR}
  </update>
  <delete id="mixingDel" parameterType="java.lang.String">
    delete from  t_mixing where  mixing_id=#{mixingId}
  </delete>
</mapper>