<?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.suSteelCageMaterialLabel.mapper.SuSteelCageMaterialLabelMapper">
|
|
|
<insert id="insertAndUpdate">
|
insert into t_su_steel_cage_material_label
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="region != null">
|
region,
|
</if>
|
<if test="materialName != null">
|
materialName,
|
</if>
|
<if test="manufacturer != null">
|
manufacturer,
|
</if>
|
<if test="specifications != null">
|
specifications,
|
</if>
|
<if test="heatNumber != null">
|
heatNumber,
|
</if>
|
<if test="inNumber != null">
|
inNumber,
|
</if>
|
<if test="reportTime != null">
|
reportTime,
|
</if>
|
<if test="reportNum != null">
|
reportNum,
|
</if>
|
<if test="status != null">
|
status,
|
</if>
|
<if test="companyId != null">
|
companyId,
|
</if>
|
<if test="isUse != null">
|
isUse,
|
</if>
|
<if test="createTime != null">
|
createTime,
|
</if>
|
<if test="createUser != null">
|
createUser,
|
</if>
|
<if test="updateTime != null">
|
updateTime,
|
</if>
|
<if test="updateUser != null">
|
updateUser,
|
</if>
|
<if test="type != null">
|
type,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="region != null">
|
#{region,jdbcType=VARCHAR},
|
</if>
|
<if test="materialName != null">
|
#{materialName,jdbcType=VARCHAR},
|
</if>
|
<if test="manufacturer != null">
|
#{manufacturer,jdbcType=VARCHAR},
|
</if>
|
<if test="specifications != null">
|
#{specifications,jdbcType=VARCHAR},
|
</if>
|
<if test="heatNumber != null">
|
#{heatNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="inNumber != null">
|
#{inNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="reportTime != null">
|
#{reportTime,jdbcType=VARCHAR},
|
</if>
|
<if test="reportNum != null">
|
#{reportNum,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null">
|
#{status,jdbcType=INTEGER},
|
</if>
|
<if test="companyId != null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</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="type != null">
|
#{type,jdbcType=INTEGER},
|
</if>
|
</if>
|
|
</trim>
|
on duplicate key update
|
<trim suffixOverrides=",">
|
<if test="region != null">
|
region = #{region,jdbcType=VARCHAR},
|
</if>
|
<if test="materialName != null">
|
materialName = #{materialName,jdbcType=VARCHAR},
|
</if>
|
<if test="manufacturer != null">
|
manufacturer = #{manufacturer,jdbcType=VARCHAR},
|
</if>
|
<if test="specifications != null">
|
specifications = #{specifications,jdbcType=VARCHAR},
|
</if>
|
<if test="heatNumber != null">
|
heatNumber = #{heatNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="inNumber != null">
|
inNumber = #{inNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="reportTime != null">
|
reportTime = #{reportTime,jdbcType=VARCHAR},
|
</if>
|
<if test="reportNum != null">
|
reportNum = #{reportNum,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null">
|
status = #{status,jdbcType=INTEGER},
|
</if>
|
<if test="companyId != null">
|
companyId = #{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
isUse = #{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="createTime != null">
|
createTime = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
createUser = #{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="updateTime != null">
|
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUser != null">
|
updateUser = #{updateUser,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null">
|
type = #{type,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
|
<delete id="delete">
|
update t_su_steel_cage_material_label set isUse = 0 where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
|
<select id="selectPageList" resultType="com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity">
|
SELECT
|
t.id,
|
t.region,
|
t.materialName,
|
t.manufacturer,
|
t.specifications,
|
t.heatNumber,
|
t.inNumber,
|
t.reportTime,
|
t.reportNum,
|
t.status,
|
t.companyId,
|
t.isUse,
|
t.createTime,
|
t.createUser,
|
t.updateTime,
|
t.updateUser,
|
t.type
|
FROM `t_su_steel_cage_material_label` t
|
where t.isUse = 1 and t.companyId = #{companyId}
|
<if test="region != null and region !=''">
|
and t.region = #{region}
|
</if>
|
<if test="type != null and type != ''">
|
and t.type = #{type}
|
</if>
|
<if test="startTime != null and endTime != null">
|
and t.createTime between #{startTime} and #{endTime}
|
</if>
|
order by t.createTime desc
|
</select>
|
|
<select id="selectInfo" resultType="com.thhy.materials.modules.biz.suSteelCageMaterialLabel.entity.SuSteelCageMaterialLabelEntity">
|
SELECT
|
t.id,
|
t.region,
|
t.materialName,
|
t.manufacturer,
|
t.specifications,
|
t.heatNumber,
|
t.inNumber,
|
t.reportTime,
|
t.reportNum,
|
t.status,
|
t.companyId,
|
t.isUse,
|
t.createTime,
|
t.createUser,
|
t.updateTime,
|
t.updateUser,
|
t.type
|
FROM `t_su_steel_cage_material_label` t
|
where t.isUse = 1
|
<if test="id != null and id !=''">
|
and t.id = #{id}
|
</if>
|
<if test="region != null and region !=''">
|
and t.region = #{region}
|
</if>
|
order by t.createTime desc
|
|
</select>
|
|
</mapper>
|