defence_strong_enemy/target/classes/mapper/TransportAirMapper.xml
2025-07-23 16:29:53 +08:00

96 lines
3.6 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.hshh.nation.transport.mapper.TransportAirMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hshh.nation.transport.entity.TransportAir">
<id column="id" property="id"/>
<result column="equip_name" property="equipName"/>
<result column="belong_unit" property="belongUnit"/>
<result column="plane_length" property="planeLength"/>
<result column="plane_wing" property="planeWing"/>
<result column="plane_height" property="planeHeight"/>
<result column="plane_weight" property="planeWeight"/>
<result column="plane_load_full_weight" property="planeLoadFullWeight"/>
<result column="plane_work_union" property="planeWorkUnion"/>
<result column="equip_location" property="equipLocation"/>
<result column="equip_status" property="equipStatus"/>
<result column="plane_load_max_weight" property="planeLoadMaxWeight"/>
<result column="transport_ability" property="transportAbility"/>
<result column="flight_max_speed" property="flightMaxSpeed"/>
<result column="flight_speed" property="flightSpeed"/>
<result column="flight_max_distance" property="flightMaxDistance"/>
<result column="service_date" property="serviceDate"/>
<result column="equip_meno" property="equipMeno"/>
</resultMap>
<select id="list" resultType="com.hshh.nation.transport.entity.TransportAir"
parameterType="com.hshh.nation.transport.entity.TransportAir">
SELECT
@rownum := @rownum + 1 AS seq,
t.*
FROM (
SELECT * FROM defence_transport_air
<where>
<if test="model.equipName != null and model.equipName !=''">
equip_name like concat('%',#{model.equipName},'%')
</if>
</where>
order by id asc ) t, ( SELECT @rownum := #{model.start} ) r limit
#{model.start},#{model.pageSize}
</select>
<select id="list" resultType="com.hshh.nation.transport.entity.TransportAir"
parameterType="com.hshh.nation.transport.entity.TransportAir" databaseId="dm">
SELECT
t.seq,
t.*
FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
a.*
FROM defence_transport_air a
<where>
<if test="model.equipName != null and model.equipName !=''">
equip_name like '%'||#{model.equipName}||'%'
</if>
</where>)t
WHERE t.seq > #{model.start} AND t.seq &lt;= (#{model.start} + #{model.pageSize})
</select>
<select id="count" resultType="java.lang.Long">
select count(id) from defence_transport_air
<where>
<if test="model.equipName != null and model.equipName !=''">
equip_name like concat('%',#{model.equipName},'%')
</if>
</where>
</select>
<select id="selectAllResource" resultType="com.hshh.nation.transport.bean.RegularTransportResource">
select t1.id,
'air' as typeCode,
t1.equip_name as name,
t1.flight_max_speed as speed,
'空中输送装备' as typeName
from defence_transport_air t1
union
(select t2.id,
'boat' as typeCode,
t2.equip_name as name,
t2.max_speed as speed,
'海上输送装备' as typeName
from defence_transport_boat t2)
</select>
</mapper>