<?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>
|
|
<select id="weighbridgeList" resultType="com.thhy.materials.modules.biz.weigh.entity.TWeighbridge">
|
select
|
weighbridge_id as weighbridgeId,
|
id,
|
code,
|
orgName,
|
supplyOrgName,
|
carNumber,
|
driverName,
|
matName,
|
matModel,
|
mPoundTime,
|
mPoundWeight,
|
mPoundName,
|
pPoundTime,
|
pPoundWeight,
|
pPoundName,
|
jPoundWeight,
|
buckleWeight,
|
mWeight,
|
pWeight,
|
jWeight,
|
wareName,
|
fileImage,
|
types
|
from t_weighbridge where
|
1=1
|
<if test="carNumber!=null and carNumber!='' ">
|
and carNumber like concat('%',#{carNumber},'%')
|
</if>
|
<if test="matName!=null and matName!='' ">
|
and matName like concat('%',#{matName},'%')
|
</if>
|
order by weighbridge_id desc
|
</select>
|
|
<select id="weighbridgeListType" resultType="com.thhy.materials.modules.biz.weigh.entity.TWeighbridge">
|
select
|
weighbridge_id as weighbridgeId,
|
id,
|
code,
|
orgName,
|
supplyOrgName,
|
carNumber,
|
driverName,
|
matName,
|
matModel,
|
mPoundTime,
|
mPoundWeight,
|
mPoundName,
|
pPoundTime,
|
pPoundWeight,
|
pPoundName,
|
jPoundWeight,
|
buckleWeight,
|
mWeight,
|
pWeight,
|
jWeight,
|
wareName,
|
fileImage,
|
types
|
from t_weighbridge where
|
types=1
|
</select>
|
<select id="materialStockValue" resultType="java.lang.Double">
|
select material_value as materialValue
|
from t_material_stock where material_name=#{dictId}
|
</select>
|
|
|
<insert id="materialStockRecordIns" >
|
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>
|
<update id="weighbridgeUpdateType" >
|
update t_weighbridge set
|
types=2
|
where weighbridge_id=#{weighbridgeId}
|
</update>
|
|
<select id="materialStockInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.MaterialStockRecordDto">
|
SELECT
|
s.dict_name AS materialName,
|
t.material_value AS materialValue
|
FROM
|
t_material_stock t
|
LEFT JOIN sys_dict s ON t.material_name = s.dict_id
|
</select>
|
<select id="steelInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.SteelDto">
|
select
|
steel_name as steelName,
|
steel_model as steelModel,
|
stock as stock
|
from sys_steel
|
</select>
|
<select id="assistGoodInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.AssistGoodDto">
|
select s.assist_name as s.assistName,
|
d.dict_name as assistType,
|
s.stock as stock
|
from sys_assist_good s left join sys_dict d on s.assist_type=d.dict_id
|
</select>
|
<select id="mouldInventory" resultType="com.thhy.materials.modules.biz.weigh.entity.dto.MouldDto">
|
select
|
mould_num as mouldNum,
|
free as free,
|
current_cycle_time as currentCycleTime
|
from sys_mould
|
</select>
|
<select id="steelType" resultType="com.thhy.materials.modules.biz.concret.entity.SysSteel">
|
select
|
steel_id as steelId,
|
steel_name as steelName,
|
steel_model as steelModel,
|
stock as stock
|
from
|
sys_steel
|
</select>
|
<insert id="steelRecordIn" >
|
insert into sys_steel_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="steelId != null">
|
steel_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="factoryName != null">
|
factory_name,
|
</if>
|
<if test="brand != null">
|
brand,
|
</if>
|
<if test="lineCode != null">
|
line_code,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="carName != null">
|
car_name,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="steelId != null">
|
#{steelId,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="factoryName != null">
|
#{factoryName,jdbcType=VARCHAR},
|
</if>
|
<if test="brand != null">
|
#{brand,jdbcType=VARCHAR},
|
</if>
|
<if test="lineCode != null">
|
#{lineCode,jdbcType=VARCHAR},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="carName != null">
|
#{carName,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="steelUp" >
|
update sys_steel set
|
stock=#{doubleValue}
|
where steel_id=#{steelId}
|
</update>
|
|
<select id="materialWarehouseRecordList" resultType="com.thhy.materials.modules.biz.weigh.entity.TSuMaterialWarehouseRecord">
|
select
|
id,
|
table_num as tableNum,
|
name_of_origin as nameOfOrigin,
|
material_name as materialName,
|
incoming_quantity as incomingQuantity,
|
in_time as inTime,
|
status as status,
|
inspection_date as inspectionDate,
|
report_number as reportNumber,
|
create_time as createTime,
|
`type`
|
from t_su_material_warehouse_record
|
where 1=1
|
<if test="tableNum!=null and tableNum!='' ">
|
and table_num=#{tableNum}
|
</if>
|
<if test="type!=null and type!='' ">
|
and `type`=#{type}
|
</if>
|
<if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' ">
|
and create_time between #{strTime} and #{endTime}
|
</if>
|
order by create_time desc
|
</select>
|
<insert id="materialWarehouseRecordInsert" >
|
insert into t_su_material_warehouse_record
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="tableNum != null">
|
table_num,
|
</if>
|
<if test="nameOfOrigin != null">
|
name_of_origin,
|
</if>
|
<if test="materialName != null">
|
material_name,
|
</if>
|
<if test="incomingQuantity != null">
|
incoming_quantity,
|
</if>
|
<if test="inTime != null">
|
in_time,
|
</if>
|
<if test="status != null">
|
status,
|
</if>
|
<if test="inspectionDate != null">
|
inspection_date,
|
</if>
|
<if test="reportNumber != null">
|
report_number,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="updateTime != null">
|
update_time,
|
</if>
|
<if test="updateUser != null">
|
update_user,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="tableNum != null">
|
#{tableNum,jdbcType=INTEGER},
|
</if>
|
<if test="nameOfOrigin != null">
|
#{nameOfOrigin,jdbcType=VARCHAR},
|
</if>
|
<if test="materialName != null">
|
#{materialName,jdbcType=VARCHAR},
|
</if>
|
<if test="incomingQuantity != null">
|
#{incomingQuantity,jdbcType=DOUBLE},
|
</if>
|
<if test="inTime != null">
|
#{inTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="status != null">
|
#{status,jdbcType=INTEGER},
|
</if>
|
<if test="inspectionDate != null">
|
#{inspectionDate,jdbcType=TIMESTAMP},
|
</if>
|
<if test="reportNumber != null">
|
#{reportNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUser != null">
|
#{updateUser,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
#{type,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
<update id="materialWarehouseRecordUpdate" >
|
update t_su_material_warehouse_record
|
<set>
|
<if test="tableNum != null">
|
table_num = #{tableNum,jdbcType=INTEGER},
|
</if>
|
<if test="nameOfOrigin != null">
|
name_of_origin = #{nameOfOrigin,jdbcType=VARCHAR},
|
</if>
|
<if test="materialName != null">
|
material_name = #{materialName,jdbcType=VARCHAR},
|
</if>
|
<if test="incomingQuantity != null">
|
incoming_quantity = #{incomingQuantity,jdbcType=DOUBLE},
|
</if>
|
<if test="inTime != null">
|
in_time = #{inTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="status != null">
|
status = #{status,jdbcType=INTEGER},
|
</if>
|
<if test="inspectionDate != null">
|
inspection_date = #{inspectionDate,jdbcType=TIMESTAMP},
|
</if>
|
<if test="reportNumber != null">
|
report_number = #{reportNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
create_user = #{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUser != null">
|
update_user = #{updateUser,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
is_use = #{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="companyId != null">
|
company_id = #{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
type = #{type,jdbcType=INTEGER},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<delete id="materialWarehouseRecordDel" parameterType="java.lang.String">
|
delete from t_su_material_warehouse_record where id=#{id}
|
</delete>
|
<select id="headThingJsDateValue" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue">
|
SELECT
|
DATE_FORMAT( upload_time, "%Y-%m-%d %H:00:00" ) AS uploadTime,
|
TRUNCATE(SUM(pm10)/count(pm10),0) as pm10,
|
TRUNCATE(SUM(pm25)/count(pm25),0) as pm25,
|
TRUNCATE(SUM(tsp)/count(tsp),0) as tsp,
|
TRUNCATE(SUM(temperature)/count(temperature),1) as temperature,
|
TRUNCATE(SUM(humidity)/count(humidity),1) as humidity,
|
TRUNCATE(SUM(wind_speed)/count(wind_speed),1) as windSpeed
|
FROM
|
t_data_value
|
WHERE
|
year(upload_time)=year(NOW()) AND MONTH(upload_time)=MONTH(NOW()) and DAY(upload_time)=DAY(NOW())
|
-- upload_time BETWEEN "2023-11-08 00:00:00" and "2023-11-08 23:59:59"
|
GROUP BY
|
DATE_FORMAT( upload_time, "%Y-%m-%d %H:00:00" );
|
</select>
|
<select id="headThingJsDateSmock" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataSmock">
|
select
|
smoke_id as smokeId,
|
`time` as `time`,
|
I00 as i00,
|
I01 as i01,
|
I02 as i02,
|
I03 as i03,
|
I04 as i04,
|
I05 as i05,
|
I06 as i06,
|
I07 as i07,
|
I10 as i10,
|
I11 as i11,
|
Q00 as q00,
|
Q01 as q01,
|
Q02 as q02,
|
Q03 as q03,
|
Q04 as q04,
|
Q05 as q05,
|
VB0 as vb0,
|
VB10 as vb10,
|
VB11 as vb11,
|
VB12 as vb12
|
from t_data_smock
|
order by `time` desc
|
limit 0,1
|
</select>
|
<select id="headThingJsDateValueByOne" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue">
|
select
|
data_id as dataId,
|
device_id as deviceId,
|
device_name as deviceName,
|
account_number as accountNumber,
|
upload_time as uploadTime,
|
pm25 as pm25,
|
pm10 as pm10,
|
tsp as tsp,
|
temperature as temperature,
|
humidity as humidity,
|
data6 as data6,
|
wind_speed as windSpeed,
|
wind_direction as windDirection,
|
tvoc as tvoc,
|
no2 as no2,
|
co as co,
|
so2 as so2,
|
o3 as o3,
|
noise as noise
|
from t_data_value
|
order by upload_time desc
|
limit 0,1
|
</select>
|
<select id="headThingJsDateValueMonth" resultType="com.thhy.materials.modules.biz.helmet.entity.TDataValue">
|
SELECT
|
DATE_FORMAT( upload_time, "%Y-%m-%d" ) AS uploadTime,
|
TRUNCATE(SUM(pm10)/count(pm10),0) as pm10,
|
TRUNCATE(SUM(pm25)/count(pm25),0) as pm25,
|
TRUNCATE(SUM(tsp)/count(tsp),0) as tsp,
|
TRUNCATE(SUM(temperature)/count(temperature),1) as temperature,
|
TRUNCATE(SUM(humidity)/count(humidity),1) as humidity,
|
TRUNCATE(SUM(wind_speed)/count(wind_speed),1) as windSpeed
|
FROM
|
t_data_value
|
WHERE
|
year(upload_time)=year(NOW()) AND MONTH(upload_time)=MONTH(NOW())
|
-- upload_time BETWEEN "2023-11-01 00:00:00" and "2023-11-30 23:59:59"
|
GROUP BY
|
DATE_FORMAT( upload_time, "%Y-%m-%d" );
|
</select>
|
</mapper>
|