<?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.engineering.modules.biz.device.mapper.TBigOverhaulMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.engineering.modules.biz.device.entity.TBigOverhaul">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Tue May 16 19:57:45 CST 2023.
|
-->
|
<id column="big_overhaul_id" jdbcType="VARCHAR" property="bigOverhaulId" />
|
<result column="big_device_id" jdbcType="VARCHAR" property="bigDeviceId" />
|
<result column="str_time" jdbcType="TIMESTAMP" property="strTime" />
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
<result column="effect_num" jdbcType="VARCHAR" property="effectNum" />
|
<result column="consume_cost" jdbcType="VARCHAR" property="consumeCost" />
|
<result column="is_use" jdbcType="INTEGER" property="isUse" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
</resultMap>
|
|
<insert id="overhaulInsert">
|
insert into t_big_overhaul
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="bigOverhaulId != null">
|
big_overhaul_id,
|
</if>
|
<if test="bigDeviceId != null">
|
big_device_id,
|
</if>
|
<if test="strTime != null">
|
str_time,
|
</if>
|
<if test="endTime != null">
|
end_time,
|
</if>
|
<if test="effectNum != null">
|
effect_num,
|
</if>
|
<if test="consumeCost != null">
|
consume_cost,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="notes != null">
|
notes,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="bigOverhaulId != null">
|
#{bigOverhaulId,jdbcType=VARCHAR},
|
</if>
|
<if test="bigDeviceId != null">
|
#{bigDeviceId,jdbcType=VARCHAR},
|
</if>
|
<if test="strTime != null">
|
#{strTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="endTime != null">
|
#{endTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="effectNum != null">
|
#{effectNum,jdbcType=VARCHAR},
|
</if>
|
<if test="consumeCost != null">
|
#{consumeCost,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="notes != null">
|
#{notes,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="overhaulList" resultType="com.thhy.engineering.modules.biz.device.entity.TBigOverhaul">
|
SELECT
|
tbo.big_overhaul_id as bigOverhaulId,
|
tbo.big_device_id as bigDeviceId,
|
tbo.str_time as strTime,
|
tbo.end_time as endTime,
|
tbo.effect_num as effectNum,
|
tbo.consume_cost as consumeCost,
|
tbd.big_device_name as bigDeviceName,
|
tbd.big_device_model as bigDeviceModel,
|
tbd.big_number as bigNumber,
|
tbd.big_type as bigType,
|
sd.dict_name as bigTypeName,
|
tbo.notes as notes
|
FROM
|
t_big_overhaul tbo
|
LEFT JOIN t_big_device tbd ON tbo.big_device_id = tbd.big_device_id
|
left join sys_dict sd on tbd.big_type=sd.dict_id
|
where tbo.is_use=1
|
<if test="companyId!=null and companyId!='' ">
|
and tbd.company_id=#{companyId}
|
</if>
|
<if test="bigDeviceId!=null and bigDeviceId!='' ">
|
and tbo.big_device_id=#{bigDeviceId}
|
</if>
|
<if test="bigDeviceName!=null and bigDeviceName!='' ">
|
and tbd.big_device_name like concat('%',#{bigDeviceName},'%')
|
</if>
|
<if test="bigType!=null and bigType!='' ">
|
and tbd.big_type=#{bigType}
|
</if>
|
<if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' ">
|
and ((tbo.str_time between #{strTime} and #{endTime}) or (tbo.end_time between #{strTime} and #{endTime}) )
|
</if>
|
order by tbo.create_time desc
|
</select>
|
<select id="overhaulInfo" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.device.entity.TBigOverhaul">
|
SELECT
|
tbo.big_overhaul_id as bigOverhaulId,
|
tbo.big_device_id as bigDeviceId,
|
tbo.str_time as strTime,
|
tbo.end_time as endTime,
|
tbo.effect_num as effectNum,
|
tbo.consume_cost as consumeCost,
|
tbd.big_device_name as bigDeviceName,
|
tbd.big_device_model as bigDeviceModel,
|
tbd.big_number as bigNumber,
|
tbd.big_type as bigType,
|
sd.dict_name as bigTypeName,
|
tbo.notes as notes
|
FROM
|
t_big_overhaul tbo
|
LEFT JOIN t_big_device tbd ON tbo.big_device_id = tbd.big_device_id
|
left join sys_dict sd on tbd.big_type=sd.dict_id
|
where tbo.is_use=1 and tbo.big_overhaul_id=#{bigOverhaulId}
|
</select>
|
<update id="overhaulDel" parameterType="java.lang.String">
|
update t_big_overhaul set
|
is_use=2
|
where big_overhaul_id=#{bigOverhaulId}
|
</update>
|
<update id="overhaulUpdate" >
|
update t_big_overhaul
|
<set>
|
<if test="bigDeviceId != null">
|
big_device_id = #{bigDeviceId,jdbcType=VARCHAR},
|
</if>
|
<if test="strTime != null">
|
str_time = #{strTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="endTime != null">
|
end_time = #{endTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="effectNum != null">
|
effect_num = #{effectNum,jdbcType=VARCHAR},
|
</if>
|
<if test="consumeCost != null">
|
consume_cost = #{consumeCost,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
is_use = #{isUse,jdbcType=INTEGER},
|
</if>
|
<if test="createTime != null">
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser != null">
|
create_user = #{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="notes != null">
|
notes = #{notes,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where big_overhaul_id = #{bigOverhaulId,jdbcType=VARCHAR}
|
</update>
|
<insert id="overhaulPathInsert" >
|
insert into t_big_overhaul_path
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="overhaulPathId != null">
|
overhaul_path_id,
|
</if>
|
<if test="bigOverhaulId != null">
|
big_overhaul_id,
|
</if>
|
<if test="overhaulPath != null">
|
overhaul_path,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="overhaulPathId != null">
|
#{overhaulPathId,jdbcType=VARCHAR},
|
</if>
|
<if test="bigOverhaulId != null">
|
#{bigOverhaulId,jdbcType=VARCHAR},
|
</if>
|
<if test="overhaulPath != null">
|
#{overhaulPath,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="overhaulPath" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.device.entity.TBigOverhaulPath">
|
select
|
overhaul_path_id as overhaulPathId,
|
big_overhaul_id as bigOverhaulId,
|
overhaul_path as overhaulPath
|
from t_big_overhaul_path where big_overhaul_id=#{bigOverhaulId}
|
</select>
|
<delete id="overhaulPathDel" parameterType="java.lang.String">
|
delete from t_big_overhaul_path where big_overhaul_id=#{bigOverhaulId}
|
</delete>
|
</mapper>
|