<?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.thhy.materials.modules.biz.concret.mapper.TMaterialReleaseMappper">
|
<resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.concret.entity.TMaterialRelease">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Fri Sep 15 10:50:37 CST 2023.
|
-->
|
<id column="material_release_id" jdbcType="VARCHAR" property="materialReleaseId" />
|
<result column="material_release_time" jdbcType="VARCHAR" property="materialReleaseTime" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
<result column="quantity" jdbcType="DOUBLE" property="quantity" />
|
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
|
</resultMap>
|
|
<insert id="materialReleaseInsert" useGeneratedKeys="true" keyProperty="materialReleaseId" parameterType="java.util.Map">
|
insert into t_material_release
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="materialReleaseId != null">
|
material_release_id,
|
</if>
|
<if test="materialReleaseTime != null">
|
material_release_time,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="quantity != null">
|
quantity,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="materialReleaseId != null">
|
#{materialReleaseId,jdbcType=VARCHAR},
|
</if>
|
<if test="materialReleaseTime != null">
|
#{materialReleaseTime,jdbcType=VARCHAR},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="quantity != null">
|
#{quantity,jdbcType=DOUBLE},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<insert id="releaseDataInsert" >
|
insert into t_release_data
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="releaseDataId != null">
|
release_data_id,
|
</if>
|
<if test="materialReleaseId != null">
|
material_release_id,
|
</if>
|
<if test="dictId != null">
|
dict_id,
|
</if>
|
<if test="releaseData != null">
|
release_data,
|
</if>
|
<if test="releaseType != null">
|
release_type,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="releaseDataId != null">
|
#{releaseDataId,jdbcType=VARCHAR},
|
</if>
|
<if test="materialReleaseId != null">
|
#{materialReleaseId,jdbcType=VARCHAR},
|
</if>
|
<if test="dictId != null">
|
#{dictId,jdbcType=VARCHAR},
|
</if>
|
<if test="releaseData != null">
|
#{releaseData},
|
</if>
|
<if test="releaseType != null">
|
#{releaseType,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="materialReleaseList" resultType="com.thhy.materials.modules.biz.concret.entity.TMaterialRelease">
|
|
select
|
material_release_id as materialReleaseId,
|
material_release_time as materialReleaseTime,
|
quantity as quantity
|
from
|
t_material_release
|
where is_use=1
|
<if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' ">
|
and material_release_time between #{strTime} and #{endTime}
|
</if>
|
order by material_release_time desc
|
</select>
|
|
<select id="materialDataList" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.concret.entity.TReleaseData" >
|
select
|
dict_id as dictId,
|
-- FORMAT(release_data, 4) as releaseData,
|
release_data as releaseData,
|
release_type as releaseType
|
from t_release_data
|
where
|
material_release_id =#{materialReleaseId}
|
order by release_type asc
|
</select>
|
|
<update id="materialReleaseUpdate" >
|
update t_material_release
|
<set>
|
<if test="materialReleaseTime != null">
|
material_release_time = #{materialReleaseTime,jdbcType=VARCHAR},
|
</if>
|
<if test="createUser != null">
|
create_user = #{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="quantity != null">
|
quantity = #{quantity,jdbcType=DOUBLE},
|
</if>
|
<if test="companyId != null">
|
company_id = #{companyId,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where material_release_id = #{materialReleaseId,jdbcType=VARCHAR}
|
</update>
|
|
<delete id="releaseDataDel" parameterType="java.lang.String">
|
delete from t_release_data
|
where material_release_id = #{materialReleaseId,jdbcType=VARCHAR}
|
</delete>
|
|
<update id="materialReleaseDel" parameterType="java.lang.String">
|
update t_material_release set
|
is_use=2
|
where material_release_id=#{materialReleaseId}
|
</update>
|
<select id="pieceList" resultType="com.thhy.materials.modules.biz.concret.entity.dto.PieceDto">
|
select by_id as byId from t_piece
|
where 1=1
|
<if test="byId!=null and byId!='' ">
|
and by_id=#{byId}
|
</if>
|
ORDER BY by_id desc
|
</select>
|
<select id="materialRew" resultType="com.thhy.materials.modules.biz.concret.entity.TRawMaterial">
|
select Storage as storage,
|
Material as material,
|
RecAmnt as recamnt,
|
PlanAmnt as planamnt,
|
FactAmnt as factamnt
|
from t_raw_material
|
where Piece=#{byId}
|
</select>
|
<insert id="mixingInsert" >
|
insert into t_mixing
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="mixingId != null">
|
mixing_id,
|
</if>
|
<if test="material != null">
|
material,
|
</if>
|
<if test="spec != null">
|
spec,
|
</if>
|
<if test="producer != null">
|
producer,
|
</if>
|
<if test="stove != null">
|
stove,
|
</if>
|
<if test="inNum != null">
|
in_num,
|
</if>
|
<if test="inDate != null">
|
in_date,
|
</if>
|
<if test="inspectState != null">
|
inspect_state,
|
</if>
|
<if test="reportNumber != null">
|
report_number,
|
</if>
|
<if test="stata != null">
|
stata,
|
</if>
|
<if test="siloId != null">
|
silo_id,
|
</if>
|
<if test="percentage != null">
|
percentage,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="mixingId != null">
|
#{mixingId,jdbcType=VARCHAR},
|
</if>
|
<if test="material != null">
|
#{material,jdbcType=VARCHAR},
|
</if>
|
<if test="spec != null">
|
#{spec,jdbcType=VARCHAR},
|
</if>
|
<if test="producer != null">
|
#{producer,jdbcType=VARCHAR},
|
</if>
|
<if test="stove != null">
|
#{stove,jdbcType=VARCHAR},
|
</if>
|
<if test="inNum != null">
|
#{inNum,jdbcType=VARCHAR},
|
</if>
|
<if test="inDate != null">
|
#{inDate,jdbcType=VARCHAR},
|
</if>
|
<if test="inspectState != null">
|
#{inspectState,jdbcType=INTEGER},
|
</if>
|
<if test="reportNumber != null">
|
#{reportNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="stata != null">
|
#{stata},
|
</if>
|
<if test="siloId != null">
|
#{siloId,jdbcType=VARCHAR},
|
</if>
|
<if test="percentage != null">
|
#{percentage,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="mixingList" resultType="com.thhy.materials.modules.biz.concret.entity.TMixing">
|
select
|
mixing_id as mixingId,
|
material as material,
|
spec as spec,
|
producer as producer,
|
stove as stove,
|
in_num as inNum,
|
in_date as inDate,
|
inspect_state as inspectState,
|
report_number as reportNumber,
|
stata as stata,
|
silo_id as siloId,
|
percentage as percentage
|
from t_mixing where silo_id=#{siloId}
|
order by in_date desc limit 0,1
|
</select>
|
<select id="mixingLists" resultType="com.thhy.materials.modules.biz.concret.entity.TMixing">
|
select
|
mixing_id as mixingId,
|
material as material,
|
spec as spec,
|
producer as producer,
|
stove as stove,
|
in_num as inNum,
|
in_date as inDate,
|
inspect_state as inspectState,
|
report_number as reportNumber,
|
stata as stata,
|
silo_id as siloId,
|
percentage as percentage
|
from t_mixing where silo_id=#{siloId}
|
order by in_date desc limit 0,1
|
</select>
|
<select id="siloList" resultType="com.thhy.materials.modules.biz.concret.entity.TSilo">
|
select
|
silo_id as siloId,
|
silo_name as siloName,
|
types as types
|
from t_silo where types=#{types}
|
</select>
|
</mapper>
|