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

79 lines
3.4 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.medical.mapper.MedicalBoatMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hshh.nation.medical.entity.MedicalBoat">
<id column="id" property="id" />
<result column="boat_no" property="boatNo" />
<result column="boat_name" property="boatName" />
<result column="army_logo" property="armyLogo" />
<result column="belong_unit" property="belongUnit" />
<result column="boat_length" property="boatLength" />
<result column="boat_width" property="boatWidth" />
<result column="boat_deep" property="boatDeep" />
<result column="boat_full_displacement" property="boatFullDisplacement" />
<result column="cruising_speed" property="cruisingSpeed" />
<result column="boat_continuous_strong" property="boatContinuousStrong" />
<result column="crew_count" property="crewCount" />
<result column="nurse_count" property="nurseCount" />
<result column="soldier_count" property="soldierCount" />
<result column="secure_ability" property="secureAbility" />
<result column="helicopter_count" property="helicopterCount" />
<result column="life_boat_count" property="lifeBoatCount" />
<result column="plane_location" property="planeLocation" />
<result column="plane_status" property="planeStatus" />
<result column="load_unload_time" property="loadUnloadTime" />
<result column="jar_meno" property="jarMeno" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, boat_no, boat_name, army_logo, belong_unit, boat_length, boat_width, boat_deep, boat_full_displacement, cruising_speed, boat_continuous_strong, crew_count, nurse_count, soldier_count, secure_ability, helicopter_count, life_boat_count, plane_location, plane_status, load_unload_time, jar_meno
</sql>
<select id="list" resultType="com.hshh.nation.medical.entity.MedicalBoat" parameterType="com.hshh.nation.medical.entity.MedicalBoat">
SELECT
@rownum := @rownum + 1 AS seq,
t.*
FROM (
SELECT * FROM defence_medical_boat
<where>
<if test="model.boatName != null and model.boatName !=''">
boat_name like concat('%',#{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.medical.entity.MedicalBoat" parameterType="com.hshh.nation.medical.entity.MedicalBoat" databaseId="dm">
SELECT
t.seq,
t.*
FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
a.*
FROM defence_medical_boat a
<where>
<if test="model.boatName != null and model.boatName !=''">
boat_name like '%'||#{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_medical_boat
<where>
<if test="model.boatName != null and model.boatName !=''">
boat_name like concat('%',#{boatName},'%')
</if>
</where>
</select>
</mapper>