<?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.TSteelConsumptionMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.materials.modules.biz.concret.entity.TSteelConsumption">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Tue Apr 18 09:29:47 CST 2023.
|
-->
|
<id column="consumption_id" jdbcType="VARCHAR" property="consumptionId" />
|
<result column="size_id" jdbcType="VARCHAR" property="sizeId" />
|
<result column="reinforcement_id" jdbcType="VARCHAR" property="reinforcementId" />
|
<result column="block_id" jdbcType="VARCHAR" property="blockId" />
|
<result column="pro_id" jdbcType="VARCHAR" property="proId" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
<result column="is_use" jdbcType="INTEGER" property="isUse" />
|
</resultMap>
|
|
|
<insert id="consumptionInsert" >
|
insert into t_steel_consumption
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="consumptionId != null">
|
consumption_id,
|
</if>
|
<if test="sizeId != null">
|
size_id,
|
</if>
|
<if test="reinforcementId != null">
|
reinforcement_id,
|
</if>
|
<if test="blockId != null">
|
block_id,
|
</if>
|
<if test="proId != null">
|
pro_id,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="consumptionId != null">
|
#{consumptionId,jdbcType=VARCHAR},
|
</if>
|
<if test="sizeId != null">
|
#{sizeId,jdbcType=VARCHAR},
|
</if>
|
<if test="reinforcementId != null">
|
#{reinforcementId,jdbcType=VARCHAR},
|
</if>
|
<if test="blockId != null">
|
#{blockId,jdbcType=VARCHAR},
|
</if>
|
<if test="proId != null">
|
#{proId,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
|
<insert id="steelNeedInsert">
|
insert into t_steel_need
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="consumptionId != null">
|
consumption_id,
|
</if>
|
<if test="steelId != null">
|
steel_id,
|
</if>
|
<if test="needNum != null">
|
need_num,
|
</if>
|
<if test="coefficient != null">
|
coefficient,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="consumptionId != null">
|
#{consumptionId,jdbcType=VARCHAR},
|
</if>
|
<if test="steelId != null">
|
#{steelId,jdbcType=VARCHAR},
|
</if>
|
<if test="needNum != null">
|
#{needNum,jdbcType=VARCHAR},
|
</if>
|
<if test="coefficient != null">
|
#{coefficient,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="consumptionList" resultType="com.thhy.materials.modules.biz.concret.entity.TSteelConsumption">
|
select tsc.consumption_id as consumptionId,
|
tsc.size_id as sizeId,
|
tsc.reinforcement_id as reinforcementId,
|
tsc.block_id as blockId,
|
tsc.pro_id as proId,
|
tsc.create_time as createTime,
|
sd.dict_name as sizeName,sdr.dict_name as reinforcementName,
|
sdb.dict_name as blockName,sp.pro_name as proName
|
from t_steel_consumption tsc
|
left join sys_dict sd on sd.dict_id=tsc.size_id
|
left join sys_dict sdr on sdr.dict_id=tsc.reinforcement_id
|
left join sys_dict sdb on sdb.dict_id=tsc.block_id
|
left join sys_project sp on sp.pro_id=tsc.pro_id
|
where tsc.is_use=1
|
<if test="proId!=null and proId!='' ">
|
and tsc.pro_id=#{proId}
|
</if>
|
<if test="sizeId!=null and sizeId!='' ">
|
and tsc.size_id=#{sizeId}
|
</if>
|
<if test="reinforcementId!=null and reinforcementId!='' ">
|
and tsc.reinforcement_id=#{reinforcementId}
|
</if>
|
<if test="blockId!=null and blockId!='' ">
|
and tsc.block_id=#{blockId}
|
</if>
|
<if test="companyId!=null and companyId!='' ">
|
and sp.company_id=#{companyId}
|
</if>
|
order by tsc.create_time desc
|
</select>
|
<select id="consumptionInfo" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.concret.entity.TSteelConsumption">
|
select tsc.consumption_id as consumptionId,
|
tsc.size_id as sizeId,
|
tsc.reinforcement_id as reinforcementId,
|
tsc.block_id as blockId,
|
tsc.pro_id as proId,
|
tsc.create_time as createTime,
|
sd.dict_name as sizeName,sdr.dict_name as reinforcementName,
|
sdb.dict_name as blockName,sp.pro_name as proName
|
from t_steel_consumption tsc
|
left join sys_dict sd on sd.dict_id=tsc.size_id
|
left join sys_dict sdr on sdr.dict_id=tsc.reinforcement_id
|
left join sys_dict sdb on sdb.dict_id=tsc.block_id
|
left join sys_project sp on sp.pro_id=tsc.pro_id
|
where tsc.is_use=1 and tsc.consumption_id=#{consumptionId}
|
</select>
|
|
<select id="steelNeedList" parameterType="java.lang.String" resultType="com.thhy.materials.modules.biz.concret.entity.TSteelNeed">
|
select
|
consumption_id as consumptionId,
|
steel_id as steelId,
|
need_num as needNum,
|
coefficient as coefficient
|
from t_steel_need where consumption_id=#{consumptionId}
|
</select>
|
<update id="consumptionDel" parameterType="java.lang.String">
|
update t_steel_consumption set
|
is_use=2
|
where consumption_id=#{consumptionId}
|
</update>
|
<delete id="consumptionNeedDel" parameterType="java.lang.String">
|
delete from t_steel_need where consumption_id=#{consumptionId}
|
</delete>
|
<update id="consumptionUpdate">
|
update t_steel_consumption
|
<set>
|
<if test="sizeId != null">
|
size_id = #{sizeId,jdbcType=VARCHAR},
|
</if>
|
<if test="reinforcementId != null">
|
reinforcement_id = #{reinforcementId,jdbcType=VARCHAR},
|
</if>
|
<if test="blockId != null">
|
block_id = #{blockId,jdbcType=VARCHAR},
|
</if>
|
<if test="proId != null">
|
pro_id = #{proId,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="isUse != null">
|
is_use = #{isUse,jdbcType=INTEGER},
|
</if>
|
</set>
|
where consumption_id = #{consumptionId,jdbcType=VARCHAR}
|
</update>
|
|
<select id="allByOne" resultType="java.lang.String">
|
select consumption_id as consumptionId from t_steel_consumption where is_use=1
|
<if test="sizeId!=null and sizeId!='' ">
|
and size_id=#{sizeId}
|
</if>
|
<if test="reinforcementId!=null and reinforcementId!='' ">
|
and reinforcement_id=#{reinforcementId}
|
</if>
|
<if test="blockId!=null and blockId!='' ">
|
and block_id=#{blockId}
|
</if>
|
<if test="proId!=null and proId!='' ">
|
and pro_id=#{proId}
|
</if>
|
</select>
|
|
|
</mapper>
|