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

71 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.hshh.nation.fuel.mapper.FuelBoatMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hshh.nation.fuel.entity.FuelBoat">
<id column="id" property="id" />
<result column="boat_name" property="boatName" />
<result column="boat_type" property="boatType" />
<result column="boat_length" property="boatLength" />
<result column="boat_width" property="boatWidth" />
<result column="boat_water_deep" property="boatWaterDeep" />
<result column="boat_full_water_loan" property="boatFullWaterLoan" />
<result column="boat_standard_water_loan" property="boatStandardWaterLoan" />
<result column="boat_max_speed" property="boatMaxSpeed" />
<result column="boat_ability" property="boatAbility" />
<result column="boat_worker" property="boatWorker" />
<result column="boat_load_ability" property="boatLoadAbility" />
<result column="truck_memo" property="truckMemo" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, boat_name, boat_type, boat_length, boat_width, boat_water_deep, boat_full_water_loan, boat_standard_water_loan, boat_max_speed, boat_ability, boat_worker, boat_load_ability, truck_memo
</sql>
<select id="list" resultType="com.hshh.nation.fuel.entity.FuelBoat" parameterType="com.hshh.nation.fuel.entity.FuelBoat">
SELECT
@rownum := @rownum + 1 AS seq,
t.*
FROM (
SELECT * FROM defence_fuel_boat
<where>
<if test="model.boatName != null and model.boatName !='' ">
boat_name like concat('%',#{model.boatName},'%')
</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.FuelBoat" parameterType="com.hshh.nation.fuel.entity.FuelBoat" databaseId="dm">
SELECT
t.seq,
t.*
FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
a.*
FROM defence_fuel_boat a
<where>
<if test="model.boatName != null and model.boatName !='' ">
boat_name like '%'||#{model.boatName}||'%'
</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_boat
<where>
<if test="model.boatName != null and model.boatName !='' ">
boat_name like concat('%',#{model.boatName},'%')
</if>
</where>
</select>
</mapper>