<?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.TBigInspectMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.engineering.modules.biz.device.entity.TBigInspect">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Tue May 16 10:15:55 CST 2023.
|
-->
|
<id column="big_inspect_id" jdbcType="VARCHAR" property="bigInspectId" />
|
<result column="big_device_id" jdbcType="VARCHAR" property="bigDeviceId" />
|
<result column="inspect_time" jdbcType="TIMESTAMP" property="inspectTime" />
|
<result column="inspect_result" jdbcType="VARCHAR" property="inspectResult" />
|
<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="bigInspectInsert" >
|
insert into t_big_inspect
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="bigInspectId != null">
|
big_inspect_id,
|
</if>
|
<if test="bigDeviceId != null">
|
big_device_id,
|
</if>
|
<if test="inspectTime != null">
|
inspect_time,
|
</if>
|
<if test="inspectResult != null">
|
inspect_result,
|
</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="bigInspectId != null">
|
#{bigInspectId,jdbcType=VARCHAR},
|
</if>
|
<if test="bigDeviceId != null">
|
#{bigDeviceId,jdbcType=VARCHAR},
|
</if>
|
<if test="inspectTime != null">
|
#{inspectTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="inspectResult != null">
|
#{inspectResult,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="bigInspectTypeInsert">
|
insert into t_big_inspect_type
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="inspectTypeId != null">
|
inspect_type_id,
|
</if>
|
<if test="bigInspectId != null">
|
big_inspect_id,
|
</if>
|
<if test="typeId != null">
|
type_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="inspectTypeId != null">
|
#{inspectTypeId,jdbcType=VARCHAR},
|
</if>
|
<if test="bigInspectId != null">
|
#{bigInspectId,jdbcType=VARCHAR},
|
</if>
|
<if test="typeId != null">
|
#{typeId,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="bigInspectList" resultType="com.thhy.engineering.modules.biz.device.entity.TBigInspect">
|
SELECT
|
tbi.big_inspect_id as bigInspectId,
|
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 dictName,
|
tbd.big_position as bigPosition,
|
tbi.inspect_time as inspectTime,
|
tbi.inspect_result as inspectResult,
|
tbi.create_user as createUser,
|
su.real_name as realName
|
FROM
|
t_big_inspect tbi
|
LEFT JOIN t_big_device tbd ON tbi.big_device_id = tbd.big_device_id
|
LEFT JOIN sys_dict sd ON tbd.big_type = sd.dict_id
|
LEFT JOIN sys_users su ON tbi.create_user = su.user_id
|
where tbi.is_use=1
|
<if test="companyId!=null and companyId!='' ">
|
and tbd.company_id=#{companyId}
|
</if>
|
<if test="bigDeviceId!=null and bigDeviceId!='' ">
|
and tbi.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="inspectResult!=null and inspectResult!='' ">
|
and tbi.inspect_result like concat('%',#{inspectResult},'%')
|
</if>
|
<if test="strTime!=null and strTime!='' and endTime!=null and endTime!='' ">
|
and tbi.inspect_time between #{strTime} and #{endTime}
|
</if>
|
order by tbi.create_time desc
|
</select>
|
<select id="bigInspectInfo" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.device.entity.TBigInspect">
|
SELECT
|
tbi.big_inspect_id as bigInspectId,
|
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 dictName,
|
tbd.big_position as bigPosition,
|
tbi.inspect_time as inspectTime,
|
tbi.big_device_id as bigDeviceId,
|
tbi.inspect_result as inspectResult,
|
tbi.create_user as createUser,
|
su.real_name as realName
|
FROM
|
t_big_inspect tbi
|
LEFT JOIN t_big_device tbd ON tbi.big_device_id = tbd.big_device_id
|
LEFT JOIN sys_dict sd ON tbd.big_type = sd.dict_id
|
LEFT JOIN sys_users su ON tbi.create_user = su.user_id
|
where tbi.is_use=1 and tbi.big_inspect_id=#{bigInspectId}
|
</select>
|
|
<select id="inspectTypes" parameterType="java.lang.String" resultType="com.thhy.engineering.modules.biz.device.entity.TBigInspectType">
|
select
|
tbit.inspect_type_id as inspectTypeId,
|
tbit.big_inspect_id as bigInspectId,
|
tbit.type_id as typeId,
|
sd.dict_name as typeName
|
from t_big_inspect_type
|
tbit left join sys_dict sd on tbit.type_id=sd.dict_id
|
where tbit.big_inspect_id=#{bigInspectId}
|
</select>
|
<delete id="bigTypeDel" parameterType="java.lang.String">
|
delete from t_big_inspect_type where big_inspect_id=#{bigInspectId}
|
</delete>
|
<update id="bigInspectDel" parameterType="java.lang.String">
|
update t_big_inspect set
|
is_use=2
|
where big_inspect_id=#{bigInspectId}
|
</update>
|
<update id="bigInspectUpdate">
|
update t_big_inspect
|
<set>
|
<if test="bigDeviceId != null">
|
big_device_id = #{bigDeviceId,jdbcType=VARCHAR},
|
</if>
|
<if test="inspectTime != null">
|
inspect_time = #{inspectTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="inspectResult != null">
|
inspect_result = #{inspectResult,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 big_inspect_id = #{bigInspectId,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|