83 lines
3.1 KiB
XML
83 lines
3.1 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.TransportPortMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.hshh.nation.transport.entity.TransportPort">
|
|
<id column="id" property="id"/>
|
|
<result column="port_no" property="portNo"/>
|
|
<result column="port_name" property="portName"/>
|
|
|
|
<result column="belong_army_branch" property="belongArmyBranch"/>
|
|
<result column="belong_unit" property="belongUnit"/>
|
|
<result column="port_type" property="portType"/>
|
|
<result column="work_union" property="workUnion"/>
|
|
<result column="port_palace" property="portPalace"/>
|
|
<result column="port_location" property="portLocation"/>
|
|
<result column="work_area_count" property="workAreaCount"/>
|
|
<result column="anchorages_count" property="anchoragesCount"/>
|
|
<result column="dock_count" property="dockCount"/>
|
|
<result column="berth_count" property="berthCount"/>
|
|
<result column="ro_ro_count" property="roRoCount"/>
|
|
<result column="road_count" property="roadCount"/>
|
|
<result column="cargo_count" property="cargoCount"/>
|
|
<result column="person_count" property="personCount"/>
|
|
<result column="night_operation_ability" property="nightOperationAbility"/>
|
|
<result column="jar_meno" property="jarMeno"/>
|
|
</resultMap>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
id, port_no, port_name, army_logo, belong_army_branch, belong_unit, port_type, work_union, port_palace, port_location, work_area_count, anchorages_count, dock_count, berth_count, ro_ro_count, road_count, cargo_count, person_count, night_operation_ability, jar_meno
|
|
</sql>
|
|
|
|
<select id="list" resultType="com.hshh.nation.transport.entity.TransportPort"
|
|
parameterType="com.hshh.nation.transport.entity.TransportPort">
|
|
SELECT
|
|
@rownum := @rownum + 1 AS seq,
|
|
t.*
|
|
FROM (
|
|
SELECT * FROM defence_transport_port
|
|
<where>
|
|
<if test="model.portName != null and model.portName !=''">
|
|
port_name like concat('%',#{model.portName},'%')
|
|
</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.TransportPort"
|
|
parameterType="com.hshh.nation.transport.entity.TransportPort" databaseId="dm">
|
|
SELECT
|
|
t.seq,
|
|
t.*
|
|
FROM (
|
|
SELECT
|
|
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
|
|
a.*
|
|
FROM defence_transport_port a
|
|
<where>
|
|
<if test="model.portName != null and model.portName !=''">
|
|
port_name like '%'||#{model.portName}||'%'
|
|
</if>
|
|
</where>
|
|
)t
|
|
WHERE t.seq > #{model.start} AND t.seq <= (#{model.start} + #{model.pageSize})
|
|
</select>
|
|
|
|
<select id="count" resultType="java.lang.Long">
|
|
select count(id) from defence_transport_port
|
|
<where>
|
|
<if test="model.portName != null and model.portName !=''">
|
|
port_name like concat('%',#{model.portName},'%')
|
|
</if>
|
|
</where>
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|