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.EtAdminOrderMapper">
|
|
|
|
|
|
|
|
<resultMap type="EtAdminOrder" id="EtAdminOrderResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="orderNo" column="order_no" />
|
|
|
|
<result property="deviceMac" column="device_mac" />
|
|
|
|
<result property="sn" column="sn" />
|
|
|
|
<result property="adminId" column="admin_id" />
|
2024-05-31 21:52:08 +08:00
|
|
|
<result property="areaId" column="area_id" />
|
2024-05-23 17:24:41 +08:00
|
|
|
<result property="beforeElectric" column="before_electric" />
|
|
|
|
<result property="afterElectric" column="after_electric" />
|
|
|
|
<result property="openTime" column="open_time" />
|
|
|
|
<result property="closeTime" column="close_time" />
|
|
|
|
<result property="type" column="type" />
|
|
|
|
<result property="faultId" column="fault_id" />
|
|
|
|
<result property="repairType" column="repair_type" />
|
|
|
|
<result property="status" column="status" />
|
|
|
|
<result property="isSuccess" column="is_success" />
|
|
|
|
<result property="isEffective" column="is_effective" />
|
|
|
|
<result property="address" column="address" />
|
|
|
|
<result property="completeTime" column="complete_time" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectEtAdminOrderVo">
|
2024-05-31 21:52:08 +08:00
|
|
|
select id, order_no, area_id, device_mac, sn, admin_id, before_electric, after_electric, open_time, close_time, type, fault_id, repair_type, status, is_success, is_effective, address, complete_time, create_time, remark from et_admin_order
|
2024-05-23 17:24:41 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectEtAdminOrderList" parameterType="EtAdminOrder" resultMap="EtAdminOrderResult">
|
2024-05-31 21:52:08 +08:00
|
|
|
select ao.id, ao.area_id, ao.order_no, ao.device_mac, ao.sn, ao.admin_id, ao.before_electric, ao.after_electric, ao.open_time, ao.close_time, ao.type,
|
|
|
|
ao.fault_id, ao.repair_type, ao.status, ao.is_success, ao.is_effective, ao.address, ao.complete_time, ao.create_time, ao.remark from et_admin_order ao
|
|
|
|
inner join et_area_dept ad on ad.area_id = ao.area_id
|
|
|
|
inner join sys_dept d on d.dept_id = ad.dept_id
|
|
|
|
where 1 = 1
|
|
|
|
<if test="orderNo != null and orderNo != ''"> and ao.order_no like concat('%', #{orderNo}, '%')</if>
|
|
|
|
<if test="deviceMac != null and deviceMac != ''"> and ao.device_mac like concat('%', #{deviceMac}, '%')</if>
|
|
|
|
<if test="sn != null and sn != ''"> and ao.sn like concat('%', #{sn}, '%')</if>
|
|
|
|
<if test="adminId != null "> and ao.admin_id = #{adminId}</if>
|
|
|
|
<if test="beforeElectric != null "> and ao.before_electric = #{beforeElectric}</if>
|
|
|
|
<if test="afterElectric != null "> and ao.after_electric = #{afterElectric}</if>
|
|
|
|
<if test="openTime != null "> and ao.open_time = #{openTime}</if>
|
|
|
|
<if test="closeTime != null "> and ao.close_time = #{closeTime}</if>
|
|
|
|
<if test="type != null and type != ''"> and ao.type = #{type}</if>
|
|
|
|
<if test="faultId != null and faultId != ''"> and ao.fault_id = #{faultId}</if>
|
|
|
|
<if test="repairType != null and repairType != ''"> and ao.repair_type = #{repairType}</if>
|
|
|
|
<if test="status != null and status != ''"> and ao.status = #{status}</if>
|
|
|
|
<if test="isSuccess != null and isSuccess != ''"> and ao.is_success = #{isSuccess}</if>
|
|
|
|
<if test="isEffective != null and isEffective != ''"> and ao.is_effective = #{isEffective}</if>
|
|
|
|
<if test="address != null and address != ''"> and ao.address = #{address}</if>
|
|
|
|
<if test="completeTime != null "> and ao.complete_time = #{completeTime}</if>
|
|
|
|
<!-- 数据范围过滤 -->
|
|
|
|
${params.dataScope}
|
2024-05-23 17:24:41 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectEtAdminOrderById" parameterType="Long" resultMap="EtAdminOrderResult">
|
|
|
|
<include refid="selectEtAdminOrderVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
<select id="selectRepairNum" resultType="java.lang.Integer">
|
|
|
|
select count(1) from et_admin_order where type = '1' and admin_id = #{adminId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectPowerReplacementNum" resultType="java.lang.Integer">
|
|
|
|
select count(1) from et_admin_order where type = '2' and admin_id = #{adminId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="checkOrderUnique" resultType="Integer">
|
|
|
|
select count(1) from et_admin_order where sn = #{sn}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertEtAdminOrder" parameterType="EtAdminOrder" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into et_admin_order
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="orderNo != null">order_no,</if>
|
|
|
|
<if test="deviceMac != null">device_mac,</if>
|
|
|
|
<if test="sn != null">sn,</if>
|
|
|
|
<if test="adminId != null">admin_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="beforeElectric != null">before_electric,</if>
|
|
|
|
<if test="afterElectric != null">after_electric,</if>
|
|
|
|
<if test="openTime != null">open_time,</if>
|
|
|
|
<if test="closeTime != null">close_time,</if>
|
|
|
|
<if test="type != null">type,</if>
|
|
|
|
<if test="faultId != null">fault_id,</if>
|
|
|
|
<if test="repairType != null">repair_type,</if>
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
<if test="isSuccess != null">is_success,</if>
|
|
|
|
<if test="isEffective != null">is_effective,</if>
|
|
|
|
<if test="address != null">address,</if>
|
|
|
|
<if test="completeTime != null">complete_time,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="orderNo != null">#{orderNo},</if>
|
|
|
|
<if test="deviceMac != null">#{deviceMac},</if>
|
|
|
|
<if test="sn != null">#{sn},</if>
|
|
|
|
<if test="adminId != null">#{adminId},</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="beforeElectric != null">#{beforeElectric},</if>
|
|
|
|
<if test="afterElectric != null">#{afterElectric},</if>
|
|
|
|
<if test="openTime != null">#{openTime},</if>
|
|
|
|
<if test="closeTime != null">#{closeTime},</if>
|
|
|
|
<if test="type != null">#{type},</if>
|
|
|
|
<if test="faultId != null">#{faultId},</if>
|
|
|
|
<if test="repairType != null">#{repairType},</if>
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
<if test="isSuccess != null">#{isSuccess},</if>
|
|
|
|
<if test="isEffective != null">#{isEffective},</if>
|
|
|
|
<if test="address != null">#{address},</if>
|
|
|
|
<if test="completeTime != null">#{completeTime},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateEtAdminOrder" parameterType="EtAdminOrder">
|
|
|
|
update et_admin_order
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="deviceMac != null">device_mac = #{deviceMac},</if>
|
|
|
|
<if test="sn != null">sn = #{sn},</if>
|
|
|
|
<if test="adminId != null">admin_id = #{adminId},</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="beforeElectric != null">before_electric = #{beforeElectric},</if>
|
|
|
|
<if test="afterElectric != null">after_electric = #{afterElectric},</if>
|
|
|
|
<if test="openTime != null">open_time = #{openTime},</if>
|
|
|
|
<if test="closeTime != null">close_time = #{closeTime},</if>
|
|
|
|
<if test="type != null">type = #{type},</if>
|
|
|
|
<if test="faultId != null">fault_id = #{faultId},</if>
|
|
|
|
<if test="repairType != null">repair_type = #{repairType},</if>
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
<if test="isSuccess != null">is_success = #{isSuccess},</if>
|
|
|
|
<if test="isEffective != null">is_effective = #{isEffective},</if>
|
|
|
|
<if test="address != null">address = #{address},</if>
|
|
|
|
<if test="completeTime != null">complete_time = #{completeTime},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
</trim>
|
|
|
|
where order_no = #{orderNo}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteEtAdminOrderById" parameterType="Long">
|
|
|
|
delete from et_admin_order where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteEtAdminOrderByIds" parameterType="String">
|
|
|
|
delete from et_admin_order where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|