71 lines
2.8 KiB
XML
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.medical.mapper.MedicalArmyMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.hshh.nation.medical.entity.MedicalArmy">
|
|
<id column="id" property="id" />
|
|
<result column="army_no" property="armyNo" />
|
|
<result column="army_name" property="armyName" />
|
|
<result column="army_type" property="armyType" />
|
|
<result column="army_level" property="armyLevel" />
|
|
<result column="army_location" property="armyLocation" />
|
|
<result column="blood_plasma_max" property="bloodPlasmaMax" />
|
|
<result column="express_max_bed" property="expressMaxBed" />
|
|
<result column="operation_table" property="operationTable" />
|
|
<result column="serious_casualty_monitor_ability" property="seriousCasualtyMonitorAbility" />
|
|
<result column="wild_vehicle_count" property="wildVehicleCount" />
|
|
<result column="casualty_vehicle_count" property="casualtyVehicleCount" />
|
|
<result column="jar_meno" property="jarMeno" />
|
|
</resultMap>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
id, army_no, army_name, army_type, army_level, army_location, blood_plasma_max, express_max_bed, operation_table, serious_casualty_monitor_ability, wild_vehicle_count, casualty_vehicle_count, jar_meno
|
|
</sql>
|
|
|
|
<select id="list" resultType="com.hshh.nation.medical.entity.MedicalArmy" parameterType="com.hshh.nation.medical.entity.MedicalArmy">
|
|
SELECT
|
|
@rownum := @rownum + 1 AS seq,
|
|
t.*
|
|
FROM (
|
|
SELECT * FROM defence_medical_army
|
|
<where>
|
|
<if test="model.armyName != null and model.armyName !=''">
|
|
army_name concat('%',#{model.armyName},'%')
|
|
</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.MedicalArmy" parameterType="com.hshh.nation.medical.entity.MedicalArmy" databaseId="dm">
|
|
SELECT
|
|
t.seq,
|
|
t.*
|
|
FROM (
|
|
SELECT
|
|
ROW_NUMBER() OVER (ORDER BY id ASC) AS seq,
|
|
a.*
|
|
FROM defence_medical_army a
|
|
<where>
|
|
<if test="model.armyName != null and model.armyName !=''">
|
|
army_name '%'||#{model.armyName}||'%'
|
|
</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_medical_army
|
|
<where>
|
|
<if test="model.armyName != null and model.armyName !=''">
|
|
army_name like concat('%',#{model.armyNo},'%')
|
|
</if>
|
|
</where>
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|