89 lines
3.8 KiB
XML
89 lines
3.8 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.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" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectEtFaultVo">
|
||
|
|
select fault_id, user_id, device_mac, type, create_time, picture, detail, order_id, status from et_fault
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectEtFaultList" parameterType="EtFault" resultMap="EtFaultResult">
|
||
|
|
<include refid="selectEtFaultVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||
|
|
</where>
|
||
|
|
</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>
|
||
|
|
<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>
|
||
|
|
<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>
|
||
|
|
<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>
|