<?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.weigh.mapper.WeighMapper">
|
|
<select id="queryAll" parameterType="com.thhy.materials.modules.biz.weigh.dto.QueryWeighDto" resultType="com.thhy.materials.modules.biz.weigh.entity.WeighVo">
|
SELECT
|
t.weigh_id weighId,
|
t.serial_number serialNumber,
|
t.car_number carNumber,
|
t.weigh_type weighType,
|
t.forwarding_unit forwardingUnit,
|
t.consignee consignee,
|
t.trade_name tradeName,
|
t.specifications specifications,
|
t.gross_weight grossWeight,
|
t.tare tare ,
|
t.net_weight netWeight ,
|
t.buckle_weight buckleWeight,
|
t.actual_weight actualWeight,
|
t.unit_price unitPrice,
|
t.amount_of_money amountOfMoney,
|
t.coefficient_of_reduction coefficientOfReduction,
|
t.quantity quantity,
|
t.weighing_fee weighingFee,
|
t.gross_weight_weigher grossWeightWeigher,
|
t.tare_weightman tareWeightman,
|
t.gross_pound grossPound,
|
t.pi_pound piPound,
|
t.gross_time grossTime,
|
t.skin_time skinTime,
|
t.one_cross_time oneCrossTime,
|
t.two_cross_time twoCrossTime,
|
t.update_by updateBy,
|
t.update_time updateTime,
|
t.notes notes
|
FROM t_weigh t
|
where
|
1=1
|
<if test="startTime != null and startTime != '' and endTime!=null and endTime!=''">
|
and t.update_time BETWEEN #{startTime} and #{endTime}
|
</if>
|
<if test="carNumber != null and carNumber!=''">
|
and t.car_number like CONCAT('%',#{carNumber} ,'%')
|
</if>
|
<if test="tradeName != null and tradeName!=''">
|
and t.trade_name like CONCAT('%',#{tradeName} ,'%')
|
</if>
|
order by update_time desc
|
</select>
|
|
|
<select id="mixingPlantId" parameterType="java.lang.String" resultType="java.lang.Integer">
|
select by_id from t_minxing_plant
|
order by by_id desc limit 0,1
|
</select>
|
<select id="mixingPlantIdNew" parameterType="java.lang.String" resultType="java.lang.Integer">
|
select by_id from t_minxing_plant_new
|
order by by_id desc limit 0,1
|
</select>
|
|
<select id="findAlltask" resultType="com.thhy.materials.modules.biz.concret.entity.dto.WeighDto">
|
SELECT
|
t.weigh_id weighId,
|
t.serial_number serialNumber,
|
t.car_number carNumber,
|
t.weigh_type weighType,
|
t.forwarding_unit forwardingUnit,
|
t.consignee consignee,
|
t.trade_name tradeName,
|
t.specifications specifications,
|
t.gross_weight grossWeight,
|
t.tare tare ,
|
t.net_weight netWeight ,
|
t.buckle_weight buckleWeight,
|
t.actual_weight actualWeight,
|
t.unit_price unitPrice,
|
t.amount_of_money amountOfMoney,
|
t.coefficient_of_reduction coefficientOfReduction,
|
t.quantity quantity,
|
t.weighing_fee weighingFee,
|
t.gross_weight_weigher grossWeightWeigher,
|
t.tare_weightman tareWeightman,
|
t.gross_pound grossPound,
|
t.pi_pound piPound,
|
t.gross_time grossTime,
|
t.skin_time skinTime,
|
t.one_cross_time oneCrossTime,
|
t.two_cross_time twoCrossTime,
|
t.update_by updateBy,
|
t.update_time updateTime,
|
t.notes notes,
|
t.by_id as byId
|
FROM t_weigh t
|
where t.by_id > #{byId}
|
and t.trade_name=#{dictName}
|
</select>
|
<select id="findAlltaskNew" resultType="com.thhy.materials.modules.biz.concret.entity.dto.WeighDto">
|
SELECT
|
t.weigh_id weighId,
|
t.serial_number serialNumber,
|
t.car_number carNumber,
|
t.weigh_type weighType,
|
t.forwarding_unit forwardingUnit,
|
t.consignee consignee,
|
t.trade_name tradeName,
|
t.specifications specifications,
|
t.gross_weight grossWeight,
|
t.tare tare ,
|
t.net_weight netWeight ,
|
t.buckle_weight buckleWeight,
|
t.actual_weight actualWeight,
|
t.unit_price unitPrice,
|
t.amount_of_money amountOfMoney,
|
t.coefficient_of_reduction coefficientOfReduction,
|
t.quantity quantity,
|
t.weighing_fee weighingFee,
|
t.gross_weight_weigher grossWeightWeigher,
|
t.tare_weightman tareWeightman,
|
t.gross_pound grossPound,
|
t.pi_pound piPound,
|
t.gross_time grossTime,
|
t.skin_time skinTime,
|
t.one_cross_time oneCrossTime,
|
t.two_cross_time twoCrossTime,
|
t.update_by updateBy,
|
t.update_time updateTime,
|
t.notes notes,
|
t.by_id as byId
|
FROM t_weigh_new t
|
where t.by_id > #{byId}
|
and t.trade_name=#{dictName}
|
</select>
|
<select id="findAlltaskAll" resultType="com.thhy.materials.modules.biz.concret.entity.dto.WeighDto">
|
SELECT
|
t.weigh_id weighId,
|
t.serial_number serialNumber,
|
t.car_number carNumber,
|
t.weigh_type weighType,
|
t.forwarding_unit forwardingUnit,
|
t.consignee consignee,
|
t.trade_name tradeName,
|
t.specifications specifications,
|
t.gross_weight grossWeight,
|
t.tare tare ,
|
t.net_weight netWeight ,
|
t.buckle_weight buckleWeight,
|
t.actual_weight actualWeight,
|
t.unit_price unitPrice,
|
t.amount_of_money amountOfMoney,
|
t.coefficient_of_reduction coefficientOfReduction,
|
t.quantity quantity,
|
t.weighing_fee weighingFee,
|
t.gross_weight_weigher grossWeightWeigher,
|
t.tare_weightman tareWeightman,
|
t.gross_pound grossPound,
|
t.pi_pound piPound,
|
t.gross_time grossTime,
|
t.skin_time skinTime,
|
t.one_cross_time oneCrossTime,
|
t.two_cross_time twoCrossTime,
|
t.update_by updateBy,
|
t.update_time updateTime,
|
t.notes notes,
|
t.by_id as byId
|
FROM t_weigh t
|
where
|
t.trade_name=#{dictName}
|
</select>
|
<select id="findAlltaskAllNew" resultType="com.thhy.materials.modules.biz.concret.entity.dto.WeighDto">
|
SELECT
|
t.weigh_id weighId,
|
t.serial_number serialNumber,
|
t.car_number carNumber,
|
t.weigh_type weighType,
|
t.forwarding_unit forwardingUnit,
|
t.consignee consignee,
|
t.trade_name tradeName,
|
t.specifications specifications,
|
t.gross_weight grossWeight,
|
t.tare tare ,
|
t.net_weight netWeight ,
|
t.buckle_weight buckleWeight,
|
t.actual_weight actualWeight,
|
t.unit_price unitPrice,
|
t.amount_of_money amountOfMoney,
|
t.coefficient_of_reduction coefficientOfReduction,
|
t.quantity quantity,
|
t.weighing_fee weighingFee,
|
t.gross_weight_weigher grossWeightWeigher,
|
t.tare_weightman tareWeightman,
|
t.gross_pound grossPound,
|
t.pi_pound piPound,
|
t.gross_time grossTime,
|
t.skin_time skinTime,
|
t.one_cross_time oneCrossTime,
|
t.two_cross_time twoCrossTime,
|
t.update_by updateBy,
|
t.update_time updateTime,
|
t.notes notes,
|
t.by_id as byId
|
FROM t_weigh_new t
|
where t.trade_name=#{dictName}
|
</select>
|
|
<select id="dictList" resultType="com.thhy.materials.modules.biz.concret.entity.dto.DicetName">
|
SELECT
|
dict_id AS dictId,
|
dict_name AS dictName
|
FROM
|
sys_dict sd
|
WHERE
|
dict_type = 'pipe_materials'
|
</select>
|
|
<select id="forwardingUnitSelectBy" parameterType="java.lang.String" resultType="java.lang.String">
|
select id from sys_supplier where supplier_name=#{forwardingUnit}
|
</select>
|
|
<insert id="minxingIn" >
|
insert into t_minxing_plant
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="mixingPlantId != null">
|
mixing_plant_id,
|
</if>
|
<if test="dictId != null">
|
dict_id,
|
</if>
|
<if test="stockType != null">
|
stock_type,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="changeStock != null">
|
change_stock,
|
</if>
|
<if test="supplierId != null">
|
supplier_id,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="carName != null">
|
car_name,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="byId != null">
|
by_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="mixingPlantId != null">
|
#{mixingPlantId,jdbcType=VARCHAR},
|
</if>
|
<if test="dictId != null">
|
#{dictId,jdbcType=VARCHAR},
|
</if>
|
<if test="stockType != null">
|
#{stockType,jdbcType=INTEGER},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="changeStock != null">
|
#{changeStock,jdbcType=DOUBLE},
|
</if>
|
<if test="supplierId != null">
|
#{supplierId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="carName != null">
|
#{carName,jdbcType=VARCHAR},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="byId != null">
|
#{byId,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
<insert id="minxingInNew" >
|
insert into t_minxing_plant_new
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="mixingPlantId != null">
|
mixing_plant_id,
|
</if>
|
<if test="dictId != null">
|
dict_id,
|
</if>
|
<if test="stockType != null">
|
stock_type,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="changeStock != null">
|
change_stock,
|
</if>
|
<if test="supplierId != null">
|
supplier_id,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="carName != null">
|
car_name,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="byId != null">
|
by_id,
|
</if>
|
<if test="isIn != null">
|
is_in,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="mixingPlantId != null">
|
#{mixingPlantId,jdbcType=VARCHAR},
|
</if>
|
<if test="dictId != null">
|
#{dictId,jdbcType=VARCHAR},
|
</if>
|
<if test="stockType != null">
|
#{stockType,jdbcType=INTEGER},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="changeStock != null">
|
#{changeStock,jdbcType=DOUBLE},
|
</if>
|
<if test="supplierId != null">
|
#{supplierId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="carName != null">
|
#{carName,jdbcType=VARCHAR},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="byId != null">
|
#{byId,jdbcType=INTEGER},
|
</if>
|
<if test="isIn != null">
|
#{isIn,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="selectMaterialValue" parameterType="java.lang.String" resultType="java.lang.Double">
|
select material_value from t_material_stock where
|
material_name=#{dictId}
|
</select>
|
<select id="selectMaterialValueNew" parameterType="java.lang.String" resultType="java.lang.Double">
|
select material_value from t_material_stock_new where
|
material_name=#{dictId}
|
</select>
|
|
<insert id="materialStockRecordIn" >
|
insert into t_material_stock_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
id,
|
<if test="createDate != null">
|
create_date,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
<if test="opType != null">
|
op_type,
|
</if>
|
<if test="materialName != null">
|
material_name,
|
</if>
|
<if test="materialValue != null">
|
material_value,
|
</if>
|
<if test="beforeStock != null">
|
before_stock,
|
</if>
|
<if test="afterStock != null">
|
after_stock,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
REPLACE(UUID(),'-',''),
|
<if test="createDate != null">
|
#{createDate,jdbcType=TIMESTAMP},
|
</if>
|
<if test="type != null">
|
#{type,jdbcType=INTEGER},
|
</if>
|
<if test="opType != null">
|
#{opType,jdbcType=INTEGER},
|
</if>
|
<if test="materialName != null">
|
#{materialName,jdbcType=VARCHAR},
|
</if>
|
<if test="materialValue != null">
|
#{materialValue,jdbcType=DOUBLE},
|
</if>
|
<if test="beforeStock != null">
|
#{beforeStock,jdbcType=DOUBLE},
|
</if>
|
<if test="afterStock != null">
|
#{afterStock,jdbcType=DOUBLE},
|
</if>
|
<if test="companyId != null">
|
#{companyId},
|
</if>
|
</trim>
|
</insert>
|
<insert id="materialStockRecordInNew" >
|
insert into t_material_stock_record_new
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
id,
|
<if test="createDate != null">
|
create_date,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
<if test="opType != null">
|
op_type,
|
</if>
|
<if test="materialName != null">
|
material_name,
|
</if>
|
<if test="materialValue != null">
|
material_value,
|
</if>
|
<if test="beforeStock != null">
|
before_stock,
|
</if>
|
<if test="afterStock != null">
|
after_stock,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
REPLACE(UUID(),'-',''),
|
<if test="createDate != null">
|
#{createDate,jdbcType=TIMESTAMP},
|
</if>
|
<if test="type != null">
|
#{type,jdbcType=INTEGER},
|
</if>
|
<if test="opType != null">
|
#{opType,jdbcType=INTEGER},
|
</if>
|
<if test="materialName != null">
|
#{materialName,jdbcType=VARCHAR},
|
</if>
|
<if test="materialValue != null">
|
#{materialValue,jdbcType=DOUBLE},
|
</if>
|
<if test="beforeStock != null">
|
#{beforeStock,jdbcType=DOUBLE},
|
</if>
|
<if test="afterStock != null">
|
#{afterStock,jdbcType=DOUBLE},
|
</if>
|
<if test="companyId != null">
|
#{companyId},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="materialStockRecordUp" >
|
update t_material_stock set
|
material_value =#{doubleValue}
|
where material_name=#{dictId}
|
</update>
|
<update id="materialStockRecordUpNew" >
|
update t_material_stock_new set
|
material_value =#{doubleValue}
|
where material_name=#{dictId}
|
</update>
|
|
<select id="videoList" resultType="com.thhy.materials.modules.biz.video.entity.TVideoNo">
|
select
|
id as id,
|
device_num as deviceNum,
|
channel_no as channelNo,
|
types as types,
|
video_path as videoPath
|
from t_video_no
|
</select>
|
<select id="videoListPage" resultType="com.thhy.materials.modules.biz.video.entity.TVideoNo">
|
select
|
id as id,
|
device_num as deviceNum,
|
channel_no as channelNo,
|
types as types,
|
video_path as videoPath
|
from t_video_no
|
where 1=1
|
<if test="types!=null and types!='' ">
|
and types=#{types}
|
</if>
|
<if test="deviceNum!=null and deviceNum!='' ">
|
and device_num like concat('%',#{deviceNum},'%')
|
</if>
|
</select>
|
<select id="webVideoList" resultType="com.thhy.materials.modules.biz.video.entity.TVideoNo">
|
select
|
id as id,
|
device_num as deviceNum,
|
channel_no as channelNo,
|
types as types,
|
video_path as videoPath
|
from t_video_no
|
where 1=1
|
<if test="types!=null and types!='' ">
|
and types=#{types}
|
</if>
|
<if test="deviceNum!=null and deviceNum!='' ">
|
and device_num like concat('%',#{deviceNum},'%')
|
</if>
|
</select>
|
|
<select id="mixingPlantIsIn" resultType="com.thhy.materials.modules.biz.concret.entity.dto.TMinxingPlant">
|
select
|
by_id as byId,
|
dict_id as dictId
|
from t_minxing_plant_new
|
where is_in=1
|
</select>
|
<select id="netWeighNew" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
select
|
net_weight as netWeight
|
from t_weigh_new
|
where by_id=#{byId}
|
</select>
|
|
<update id="netWeighUpdateNew" >
|
update t_minxing_plant_new
|
set change_stock=#{netWeight},
|
is_in=2
|
where by_id=#{byId}
|
</update>
|
|
|
</mapper>
|