2024-05-23 17:24:41 +08:00
|
|
|
<?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.system.mapper.EtFaultMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="EtFault" id="EtFaultResult">
|
|
|
|
|
<result property="faultId" column="fault_id" />
|
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
|
<result property="deviceMac" column="device_mac" />
|
|
|
|
|
<result property="type" column="type" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="picture" column="picture" />
|
|
|
|
|
<result property="detail" column="detail" />
|
|
|
|
|
<result property="orderId" column="order_id" />
|
|
|
|
|
<result property="status" column="status" />
|
2024-05-31 21:52:08 +08:00
|
|
|
<result property="areaId" column="area_id" />
|
2024-05-23 17:24:41 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEtFaultVo">
|
2024-05-31 21:52:08 +08:00
|
|
|
select fault_id, areaId, user_id, device_mac, type, create_time, picture, detail, order_id, status from et_fault
|
2024-05-23 17:24:41 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEtFaultList" parameterType="EtFault" resultMap="EtFaultResult">
|
2024-05-31 21:52:08 +08:00
|
|
|
select f.fault_id, f.area_id, f.user_id, f.device_mac, f.type, f.create_time, f.picture, f.detail, f.order_id, f.status from et_fault f
|
|
|
|
|
inner join et_area_dept ad on ad.area_id = f.area_id
|
|
|
|
|
inner join sys_dept d on d.dept_id = ad.dept_id
|
|
|
|
|
where 1 = 1
|
|
|
|
|
<if test="userId != null "> and f.user_id = #{userId}</if>
|
|
|
|
|
<if test="type != null and type != ''"> and f.type = #{type}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and f.status = #{status}</if>
|
|
|
|
|
<!-- 数据范围过滤 -->
|
|
|
|
|
${params.dataScope}
|
2024-05-23 17:24:41 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEtFaultByFaultId" parameterType="Long" resultMap="EtFaultResult">
|
|
|
|
|
<include refid="selectEtFaultVo"/>
|
|
|
|
|
where fault_id = #{faultId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertEtFault" parameterType="EtFault">
|
|
|
|
|
insert into et_fault
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="faultId != null">fault_id,</if>
|
|
|
|
|
<if test="userId != null">user_id,</if>
|
2024-05-31 21:52:08 +08:00
|
|
|
<if test="areaId != null">area_id,</if>
|
2024-05-23 17:24:41 +08:00
|
|
|
<if test="deviceMac != null">device_mac,</if>
|
|
|
|
|
<if test="type != null">type,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="picture != null">picture,</if>
|
|
|
|
|
<if test="detail != null">detail,</if>
|
|
|
|
|
<if test="orderId != null">order_id,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="faultId != null">#{faultId},</if>
|
|
|
|
|
<if test="userId != null">#{userId},</if>
|
2024-05-31 21:52:08 +08:00
|
|
|
<if test="areaId != null">#{areaId},</if>
|
2024-05-23 17:24:41 +08:00
|
|
|
<if test="deviceMac != null">#{deviceMac},</if>
|
|
|
|
|
<if test="type != null">#{type},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="picture != null">#{picture},</if>
|
|
|
|
|
<if test="detail != null">#{detail},</if>
|
|
|
|
|
<if test="orderId != null">#{orderId},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEtFault" parameterType="EtFault">
|
|
|
|
|
update et_fault
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">user_id = #{userId},</if>
|
2024-05-31 21:52:08 +08:00
|
|
|
<if test="areaId != null">area_id = #{areaId},</if>
|
2024-05-23 17:24:41 +08:00
|
|
|
<if test="deviceMac != null">device_mac = #{deviceMac},</if>
|
|
|
|
|
<if test="type != null">type = #{type},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="picture != null">picture = #{picture},</if>
|
|
|
|
|
<if test="detail != null">detail = #{detail},</if>
|
|
|
|
|
<if test="orderId != null">order_id = #{orderId},</if>
|
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where fault_id = #{faultId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEtFaultByFaultId" parameterType="Long">
|
|
|
|
|
delete from et_fault where fault_id = #{faultId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEtFaultByFaultIds" parameterType="String">
|
|
|
|
|
delete from et_fault where fault_id in
|
|
|
|
|
<foreach item="faultId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{faultId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|