100 lines
3.9 KiB
XML
100 lines
3.9 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.FuelMetalJarMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.hshh.nation.fuel.entity.FuelMetalJar">
|
|
<id column="id" property="id"/>
|
|
|
|
<result column="belong_unit" property="belongUnit"/>
|
|
<result column="jar_no" property="jarNo"/>
|
|
<result column="jar_type" property="jarType"/>
|
|
<result column="jar_capacity" property="jarCapacity"/>
|
|
<result column="inner_diameter" property="innerDiameter"/>
|
|
<result column="jar_height" property="jarHeight"/>
|
|
<result column="jar_empty_weight" property="jarEmptyWeight"/>
|
|
<result column="jar_volume" property="jarVolume"/>
|
|
<result column="jar_box_weight" property="jarBoxWeight"/>
|
|
<result column="jar_status" property="jarStatus"/>
|
|
<result column="jar_build_date" property="jarBuildDate"/>
|
|
<result column="jar_fuel_type" property="jarFuelType"/>
|
|
<result column="jar_now_fuel_type" property="jarNowFuelType"/>
|
|
<result column="jar_coordinate" property="jarCoordinate"/>
|
|
<result column="jar_meno" property="jarMeno"/>
|
|
</resultMap>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
|
|
|
|
<select id="list" resultType="com.hshh.nation.fuel.entity.FuelMetalJar"
|
|
parameterType="com.hshh.nation.fuel.entity.FuelMetalJar">
|
|
SELECT
|
|
@rownum := @rownum + 1 AS seq,
|
|
t.*
|
|
FROM (
|
|
SELECT * FROM defence_fuel_metal_jar
|
|
<where>
|
|
<if test="model.jarNo != null and model.jarNo !=''">
|
|
jar_no like concat('%',#{model.jarNo},'%')
|
|
</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.FuelMetalJar"
|
|
parameterType="com.hshh.nation.fuel.entity.FuelMetalJar" databaseId="dm">
|
|
SELECT
|
|
t.seq,
|
|
t.*
|
|
FROM (
|
|
SELECT
|
|
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
|
|
a.*
|
|
FROM defence_fuel_metal_jar a
|
|
<where>
|
|
<if test="model.jarNo != null and model.jarNo !=''">
|
|
jar_no like '%'||#{model.jarNo}||'%'
|
|
</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_fuel_metal_jar
|
|
<where>
|
|
<if test="model.jarNo != null and model.jarNo !=''">
|
|
jar_no like concat('%',#{model.jarNo},'%')
|
|
</if>
|
|
</where>
|
|
|
|
|
|
</select>
|
|
<select id="selectAllResource" resultType="com.hshh.nation.fuel.bean.FacilitiesResource">
|
|
SELECT
|
|
t.id,
|
|
t.jar_no as jarNo,
|
|
t.jar_fuel_type as jarFuelType,
|
|
t.jar_capacity as jarCapacity,
|
|
t.jar_receive_ability as jarReceiveAbility,
|
|
t.jar_current_capacity as jarCurrentCapacity,
|
|
t.jar_coordinate as location,
|
|
t.belong_unit as belongUnit,
|
|
t.belong_unit_type as belongUnitType,
|
|
1 AS resourceType
|
|
FROM
|
|
defence_fuel_metal_jar t
|
|
UNION ( select t1.id,
|
|
t1.jar_no as jarNo,
|
|
t1.jar_fuel_type as jarFuelType,
|
|
t1.jar_capacity as jarCapacity,
|
|
t1.jar_receive_ability as jarReceiveAbility,
|
|
t1.jar_current_capacity as jarCurrentCapacity,
|
|
t1.jar_coordinate as location,
|
|
t1.belong_unit as belongUnit,
|
|
t1.belong_unit_type as belongUnitType,
|
|
2 AS resourceType from defence_fuel_soft_jar t1)
|
|
</select>
|
|
|
|
</mapper>
|
|
|