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

75 lines
3.0 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.fuel.mapper.FuelPlaneMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hshh.nation.fuel.entity.FuelPlane">
<id column="id" property="id" />
<result column="plane_name" property="planeName" />
<result column="plane_icon" property="planeIcon" />
<result column="plane_type" property="planeType" />
<result column="plane_work" property="planeWork" />
<result column="plane_wing_length" property="planeWingLength" />
<result column="plane_length" property="planeLength" />
<result column="plane_height" property="planeHeight" />
<result column="plane_weight" property="planeWeight" />
<result column="plane_flight_weight" property="planeFlightWeight" />
<result column="plane_load_fuel" property="planeLoadFuel" />
<result column="plane_load_ability" property="planeLoadAbility" />
<result column="plane_max_speed" property="planeMaxSpeed" />
<result column="plane_speed" property="planeSpeed" />
<result column="plane_flight_distance" property="planeFlightDistance" />
<result column="plane_fuel_speed" property="planeFuelSpeed" />
<result column="plane_memo" property="planeMemo" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, plane_name, plane_icon, plane_type, plane_work, plane_wing_length, plane_length, plane_height, plane_weight, plane_flight_weight, plane_load_fuel, plane_load_ability, plane_max_speed, plane_speed, plane_flight_distance, plane_fuel_speed, plane_memo
</sql>
<select id="list" resultType="com.hshh.nation.fuel.entity.FuelPlane" parameterType="com.hshh.nation.fuel.entity.FuelPlane">
SELECT
@rownum := @rownum + 1 AS seq,
t.*
FROM (
SELECT * FROM defence_fuel_plane
<where>
<if test="model.planeName != null">
plane_name = #{model.planeName}
</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.fuel.entity.FuelPlane" parameterType="com.hshh.nation.fuel.entity.FuelPlane" databaseId="dm">
SELECT
t.seq,
t.*
FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
a.*
FROM defence_fuel_plane a
<where>
<if test="model.planeName != null">
plane_name like '%'||{model.planeName}||'%'
</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_fuel_plane
<where>
<if test="model.planeName != null">
plane_name = #{model.planeName}
</if>
</where>
</select>
</mapper>