74 lines
2.8 KiB
XML
74 lines
2.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.aircraft.modules.aircraft.mapper.AircraftDeviceMapper">
|
|
<!-- 飞行器设备基础映射 -->
|
|
<resultMap id="BaseResultMap" type="com.aircraft.modules.aircraft.domain.AircraftDevice">
|
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
|
<result column="name" property="name" jdbcType="VARCHAR"/>
|
|
<result column="model" property="model" jdbcType="VARCHAR"/>
|
|
<result column="brand" property="brand" jdbcType="VARCHAR"/>
|
|
<result column="use_type" property="useType" jdbcType="INTEGER"/>
|
|
<result column="area_id" property="areaId" jdbcType="BIGINT"/>
|
|
<result column="scenic_id" property="scenicId" jdbcType="BIGINT"/>
|
|
<result column="employees_id" property="employeesId" jdbcType="BIGINT"/>
|
|
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
|
<!-- 继承BaseEntity的公共字段映射 -->
|
|
<result column="create_by" property="createBy" jdbcType="VARCHAR"/>
|
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
|
<result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
|
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
|
</resultMap>
|
|
<!-- 通过设备ID列表查询飞行器设备 -->
|
|
<select id="getAircraftDeviceById" resultMap="BaseResultMap">
|
|
SELECT
|
|
id,
|
|
name,
|
|
model,
|
|
brand,
|
|
use_type,
|
|
area_id,
|
|
scenic_id,
|
|
employees_id,
|
|
remark,
|
|
create_by,
|
|
create_time,
|
|
update_by,
|
|
update_time
|
|
FROM fms_ac_aircraft_device
|
|
WHERE id IN
|
|
<foreach collection="deviceIds" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</select>
|
|
<select id="page" resultType="com.aircraft.modules.aircraft.domain.vo.AircraftDevicePageVO">
|
|
select d.id,
|
|
d.name,
|
|
d.model,
|
|
d.brand,
|
|
d.use_type,
|
|
d.area_id,
|
|
a.name as areaName,
|
|
d.scenic_id,
|
|
s.name as scenicName,
|
|
d.employees_id,
|
|
d.remark,
|
|
d.create_time
|
|
from fms_ac_aircraft_device d
|
|
left join em_area a on d.area_id = a.id
|
|
left join em_scenic s on d.scenic_id = s.id
|
|
left join em_employees e on d.employees_id = e.id
|
|
where d.del_flag = 0
|
|
<if test="search.name != null and search.name != ''">
|
|
and d.name like concat('%',#{search.name},'%')
|
|
</if>
|
|
<if test="search.employeesId != null">
|
|
and e.id = #{search.employeesId}
|
|
</if>
|
|
<if test="search.areaId != null">
|
|
and a.id = #{search.areaId}
|
|
</if>
|
|
order by d.id desc
|
|
</select>
|
|
|
|
</mapper>
|