You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

377 lines
22 KiB
XML

<?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.ruoyi.basetyre.mapper.BaseTyreMapper">
<resultMap type="BaseTyre" id="BaseTyreResult">
<result property="id" column="id" />
<result property="tyreFactory" column="tyre_factory" />
<result property="outerTireNumber" column="outer_tire_number" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="qualityStatus" column="quality_status" />
<result property="unit" column="unit" />
<result property="materialType" column="material_type" />
<result property="materialGroup" column="material_group" />
<result property="productGroup" column="product_group" />
<result property="brand" column="brand" />
<result property="category" column="category" />
<result property="size" column="size" />
<result property="pattern" column="pattern" />
<result property="consPattern" column="cons_pattern" />
<result property="hierarchy" column="hierarchy" />
<result property="speedLevel" column="speed_level" />
<result property="loadIndex" column="load_index" />
<result property="rimSize" column="rim_size" />
<result property="weight" column="weight" />
<result property="sectionWidth" column="section_width" />
<result property="outerDiameter" column="outer_diameter" />
<result property="flattening" column="flattening" />
<result property="enhanced" column="enhanced" />
<result property="innerTube" column="inner_tube" />
<result property="patternDepth" column="pattern_depth" />
<result property="ctn" column="ctn" />
<result property="type" column="type" />
<result property="certInfo" column="cert_info" />
<result property="customsSpe" column="customs_spe" />
<result property="feCode" column="fe_code" />
<result property="feDesc" column="fe_desc" />
<result property="produceFactory" column="produce_factory" />
<result property="carId" column="car_id" />
<result property="carLicense" column="car_license" />
<result property="tyrePosition" column="tyre_position" />
<result property="sensorId" column="sensor_id" />
<result property="currentTextureDepth" column="current_texture_depth" />
<result property="state" column="state" />
<result property="isDelete" column="is_delete" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
<result property="createBy" column="create_by" />
<result property="createName" column="create_name" />
<result property="modifyTime" column="modify_time" />
<result property="modifyId" column="modify_id" />
<result property="modifyBy" column="modify_by" />
<result property="modifyName" column="modify__name" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBaseTyreVo">
select id, tyre_factory, outer_tire_number, material_code, material_name, quality_status, unit, material_type, material_group, product_group, brand, category, size, pattern, cons_pattern, hierarchy, speed_level, load_index, rim_size, weight, section_width, outer_diameter, flattening, enhanced, inner_tube, pattern_depth, ctn, type, cert_info, customs_spe, fe_code, fe_desc, produce_factory, car_id, car_license, tyre_position, sensor_id, current_texture_depth, state, is_delete, create_time, create_id, create_by, create_name, modify_time, modify_id, modify_by, modify__name, remark from base_tyre
</sql>
<select id="selectBaseTyreList" parameterType="BaseTyre" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
<where>
<if test="tyreFactory != null and tyreFactory != ''"> and tyre_factory = #{tyreFactory}</if>
<if test="outerTireNumber != null and outerTireNumber != ''"> and outer_tire_number = #{outerTireNumber}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="materialGroup != null and materialGroup != ''"> and material_group = #{materialGroup}</if>
<if test="productGroup != null and productGroup != ''"> and product_group = #{productGroup}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="category != null and category != ''"> and category = #{category}</if>
<if test="size != null and size != ''"> and size = #{size}</if>
<if test="pattern != null and pattern != ''"> and pattern = #{pattern}</if>
<if test="consPattern != null and consPattern != ''"> and cons_pattern = #{consPattern}</if>
<if test="hierarchy != null and hierarchy != ''"> and hierarchy = #{hierarchy}</if>
<if test="speedLevel != null and speedLevel != ''"> and speed_level = #{speedLevel}</if>
<if test="loadIndex != null "> and load_index = #{loadIndex}</if>
<if test="rimSize != null "> and rim_size = #{rimSize}</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="sectionWidth != null "> and section_width = #{sectionWidth}</if>
<if test="outerDiameter != null "> and outer_diameter = #{outerDiameter}</if>
<if test="flattening != null "> and flattening = #{flattening}</if>
<if test="enhanced != null and enhanced != ''"> and enhanced = #{enhanced}</if>
<if test="innerTube != null and innerTube != ''"> and inner_tube = #{innerTube}</if>
<if test="patternDepth != null "> and pattern_depth = #{patternDepth}</if>
<if test="ctn != null "> and ctn = #{ctn}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="certInfo != null and certInfo != ''"> and cert_info = #{certInfo}</if>
<if test="customsSpe != null and customsSpe != ''"> and customs_spe = #{customsSpe}</if>
<if test="feCode != null and feCode != ''"> and fe_code = #{feCode}</if>
<if test="feDesc != null and feDesc != ''"> and fe_desc = #{feDesc}</if>
<if test="produceFactory != null and produceFactory != ''"> and produce_factory = #{produceFactory}</if>
<if test="carId != null and carId != ''"> and car_id = #{carId}</if>
<if test="carLicense != null and carLicense != ''"> and car_license = #{carLicense}</if>
<if test="tyrePosition != null and tyrePosition != ''"> and tyre_position = #{tyrePosition}</if>
<if test="sensorId != null and sensorId != ''"> and sensor_id = #{sensorId}</if>
<if test="currentTextureDepth != null "> and current_texture_depth = #{currentTextureDepth}</if>
<if test="state != null "> and state = #{state}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="createId != null and createId != ''"> and create_id = #{createId}</if>
<if test="createName != null and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
<if test="modifyTime != null "> and modify_time = #{modifyTime}</if>
<if test="modifyId != null and modifyId != ''"> and modify_id = #{modifyId}</if>
<if test="modifyBy != null and modifyBy != ''"> and modify_by = #{modifyBy}</if>
<if test="modifyName != null and modifyName != ''"> and modify__name like concat('%', #{modifyName}, '%')</if>
</where>
</select>
<select id="selectBaseTyreById" parameterType="String" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where id = #{id}
</select>
<select id="getTyreInfoById" parameterType="String" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where outer_tire_number = #{outerTireNumber}
</select>
<select id="getTyreLife" resultType="java.util.Map">
</select>
<select id="checkBaseTyreUnique" resultType="com.ruoyi.basetyre.domain.BaseTyre">
select id, outer_tire_number as outerTireNumber
from base_tyre
where outer_tire_number = #{outerTireNumber}
and is_delete = '0'
</select>
<insert id="insertBaseTyre" parameterType="BaseTyre">
insert into base_tyre
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="tyreFactory != null">tyre_factory,</if>
<if test="outerTireNumber != null">outer_tire_number,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="qualityStatus != null">quality_status,</if>
<if test="unit != null">unit,</if>
<if test="materialType != null">material_type,</if>
<if test="materialGroup != null">material_group,</if>
<if test="productGroup != null">product_group,</if>
<if test="brand != null">brand,</if>
<if test="category != null">category,</if>
<if test="size != null">size,</if>
<if test="pattern != null">pattern,</if>
<if test="consPattern != null">cons_pattern,</if>
<if test="hierarchy != null">hierarchy,</if>
<if test="speedLevel != null">speed_level,</if>
<if test="loadIndex != null">load_index,</if>
<if test="rimSize != null">rim_size,</if>
<if test="weight != null">weight,</if>
<if test="sectionWidth != null">section_width,</if>
<if test="outerDiameter != null">outer_diameter,</if>
<if test="flattening != null">flattening,</if>
<if test="enhanced != null">enhanced,</if>
<if test="innerTube != null">inner_tube,</if>
<if test="patternDepth != null">pattern_depth,</if>
<if test="ctn != null">ctn,</if>
<if test="type != null">type,</if>
<if test="certInfo != null">cert_info,</if>
<if test="customsSpe != null">customs_spe,</if>
<if test="feCode != null">fe_code,</if>
<if test="feDesc != null">fe_desc,</if>
<if test="produceFactory != null">produce_factory,</if>
<if test="carId != null">car_id,</if>
<if test="carLicense != null">car_license,</if>
<if test="tyrePosition != null">tyre_position,</if>
<if test="sensorId != null">sensor_id,</if>
<if test="currentTextureDepth != null">current_texture_depth,</if>
<if test="state != null">state,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createName != null">create_name,</if>
<if test="modifyTime != null">modify_time,</if>
<if test="modifyId != null">modify_id,</if>
<if test="modifyBy != null">modify_by,</if>
<if test="modifyName != null">modify__name,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tyreFactory != null">#{tyreFactory},</if>
<if test="outerTireNumber != null">#{outerTireNumber},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="qualityStatus != null">#{qualityStatus},</if>
<if test="unit != null">#{unit},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialGroup != null">#{materialGroup},</if>
<if test="productGroup != null">#{productGroup},</if>
<if test="brand != null">#{brand},</if>
<if test="category != null">#{category},</if>
<if test="size != null">#{size},</if>
<if test="pattern != null">#{pattern},</if>
<if test="consPattern != null">#{consPattern},</if>
<if test="hierarchy != null">#{hierarchy},</if>
<if test="speedLevel != null">#{speedLevel},</if>
<if test="loadIndex != null">#{loadIndex},</if>
<if test="rimSize != null">#{rimSize},</if>
<if test="weight != null">#{weight},</if>
<if test="sectionWidth != null">#{sectionWidth},</if>
<if test="outerDiameter != null">#{outerDiameter},</if>
<if test="flattening != null">#{flattening},</if>
<if test="enhanced != null">#{enhanced},</if>
<if test="innerTube != null">#{innerTube},</if>
<if test="patternDepth != null">#{patternDepth},</if>
<if test="ctn != null">#{ctn},</if>
<if test="type != null">#{type},</if>
<if test="certInfo != null">#{certInfo},</if>
<if test="customsSpe != null">#{customsSpe},</if>
<if test="feCode != null">#{feCode},</if>
<if test="feDesc != null">#{feDesc},</if>
<if test="produceFactory != null">#{produceFactory},</if>
<if test="carId != null">#{carId},</if>
<if test="carLicense != null">#{carLicense},</if>
<if test="tyrePosition != null">#{tyrePosition},</if>
<if test="sensorId != null">#{sensorId},</if>
<if test="currentTextureDepth != null">#{currentTextureDepth},</if>
<if test="state != null">#{state},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createName != null">#{createName},</if>
<if test="modifyTime != null">#{modifyTime},</if>
<if test="modifyId != null">#{modifyId},</if>
<if test="modifyBy != null">#{modifyBy},</if>
<if test="modifyName != null">#{modifyName},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<insert id="insertBaseTyreList" parameterType="java.util.List">
insert into base_tyre (id, tyre_factory, outer_tire_number, material_code, material_name,
quality_status, unit, material_type, material_group, product_group, brand, category, size,
pattern, cons_pattern, hierarchy, speed_level, load_index, rim_size, weight, section_width,
outer_diameter, flattening, enhanced, inner_tube, pattern_depth, ctn, type, cert_info, customs_spe,
fe_code, fe_desc, produce_factory, car_id, car_license, tyre_position, sensor_id, current_texture_depth,
state, is_delete, create_time, create_id, create_by, create_name )
values
<foreach collection="list" item="t" index="index" separator=",">
<trim prefix="(" suffix=")">
#{t.id},
#{t.tyreFactory},
#{t.outerTireNumber},
#{t.materialCode},
#{t.materialName},
#{t.qualityStatus},
#{t.unit},
#{t.materialType},
#{t.materialGroup},
#{t.productGroup},
#{t.brand},
#{t.category},
#{t.size},
#{t.pattern},
#{t.consPattern},
#{t.hierarchy},
#{t.speedLevel},
#{t.loadIndex},
#{t.rimSize},
#{t.weight},
#{t.sectionWidth},
#{t.outerDiameter},
#{t.flattening},
#{t.enhanced},
#{t.innerTube},
#{t.patternDepth},
#{t.ctn},
#{t.type},
#{t.certInfo},
#{t.customsSpe},
#{t.feCode},
#{t.feDesc},
#{t.produceFactory},
#{t.carId},
#{t.carLicense},
#{t.tyrePosition},
#{t.sensorId},
#{t.currentTextureDepth},
#{t.state},
#{t.isDelete},
#{t.createTime},
#{t.createId},
#{t.createBy},
#{t.createName}
</trim>
</foreach>
</insert>
<!-- <insert id="insertBaseTyreList" parameterType="java.util.List">-->
<!-- insert into base_tyre(id)-->
<!-- <foreach collection ="list" item="baseTyreVO" separator =",">-->
<!-- (#{baseTyreVO.id})-->
<!-- </foreach >-->
<!-- </insert>-->
<update id="updateBaseTyre" parameterType="BaseTyre">
update base_tyre
<trim prefix="SET" suffixOverrides=",">
<if test="tyreFactory != null">tyre_factory = #{tyreFactory},</if>
<if test="outerTireNumber != null">outer_tire_number = #{outerTireNumber},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="qualityStatus != null">quality_status = #{qualityStatus},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialGroup != null">material_group = #{materialGroup},</if>
<if test="productGroup != null">product_group = #{productGroup},</if>
<if test="brand != null">brand = #{brand},</if>
<if test="category != null">category = #{category},</if>
<if test="size != null">size = #{size},</if>
<if test="pattern != null">pattern = #{pattern},</if>
<if test="consPattern != null">cons_pattern = #{consPattern},</if>
<if test="hierarchy != null">hierarchy = #{hierarchy},</if>
<if test="speedLevel != null">speed_level = #{speedLevel},</if>
<if test="loadIndex != null">load_index = #{loadIndex},</if>
<if test="rimSize != null">rim_size = #{rimSize},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="sectionWidth != null">section_width = #{sectionWidth},</if>
<if test="outerDiameter != null">outer_diameter = #{outerDiameter},</if>
<if test="flattening != null">flattening = #{flattening},</if>
<if test="enhanced != null">enhanced = #{enhanced},</if>
<if test="innerTube != null">inner_tube = #{innerTube},</if>
<if test="patternDepth != null">pattern_depth = #{patternDepth},</if>
<if test="ctn != null">ctn = #{ctn},</if>
<if test="type != null">type = #{type},</if>
<if test="certInfo != null">cert_info = #{certInfo},</if>
<if test="customsSpe != null">customs_spe = #{customsSpe},</if>
<if test="feCode != null">fe_code = #{feCode},</if>
<if test="feDesc != null">fe_desc = #{feDesc},</if>
<if test="produceFactory != null">produce_factory = #{produceFactory},</if>
<if test="carId != null">car_id = #{carId},</if>
<if test="carLicense != null">car_license = #{carLicense},</if>
<if test="tyrePosition != null">tyre_position = #{tyrePosition},</if>
<if test="sensorId != null">sensor_id = #{sensorId},</if>
<if test="currentTextureDepth != null">current_texture_depth = #{currentTextureDepth},</if>
<if test="state != null">state = #{state},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createName != null">create_name = #{createName},</if>
<if test="modifyTime != null">modify_time = #{modifyTime},</if>
<if test="modifyId != null">modify_id = #{modifyId},</if>
<if test="modifyBy != null">modify_by = #{modifyBy},</if>
<if test="modifyName != null">modify__name = #{modifyName},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<update id="UnInstallTyre" parameterType="BaseTyre">
update base_tyre set car_license=null,car_id=null ,sensor_id=null ,tyre_position=null ,modify_time = #{modifyTime},modify_id = #{modifyId},modify_by = #{modifyBy},modify__name = #{modifyName},current_texture_depth = #{currentTextureDepth} where id = #{id}
</update>
<!-- <delete id="deleteBaseTyreById" parameterType="String">-->
<!-- delete from base_tyre where id = #{id}-->
<!-- </delete>-->
<!-- -->
<update id="deleteBaseTyreById" parameterType="String">
update base_tyre set is_delete = '1' where id = #{id}
</update>
<update id="deleteBaseTyreByIds" parameterType="String">
update base_tyre set is_delete = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>