Commit dabef013 authored by zhengjiawei's avatar zhengjiawei

bug

parent 0465b044
<?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.yeejoin.amos.fas.business.dao.mapper.FireStationMapper">
<select id="queryOne" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.address,
fs.floor3d,
fs.position3d,
fs.is_indoor AS isIndoor,
fs.picture,
fs.risk_source_id as riskSourceId
FROM
f_fire_station fs
WHERE
fs.id = ${id}
</select>
<select id="queryCountForFireEqumntPage" resultType="long">
SELECT
count(1)
FROM
f_fire_station_equipment fs
JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id
WHERE
fs.fire_station_id = ${fireStationId}
</select>
<select id="queryForFireEqumntPage" resultType="java.util.Map">
SELECT
fs.fire_station_id,
fs.number numberInStation,
fs.unit unitInStation,
f.*,
frs.name riskSourceName
FROM
f_fire_station_equipment fs
left join f_fire_equipment f ON fs.fire_equipment_id = f.id
left join f_risk_source frs on frs.id = f.risk_source_id
WHERE
fs.fire_station_id = ${fireStationId}
and f.id is not null
LIMIT ${start}, ${length};
</select>
<select id="queryCountForPage" resultType="long">
SELECT
COUNT(1)
FROM
f_fire_station fs
WHERE
1=1
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%';
</if>
</select>
<select id="queryForPage" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.address,
fs.floor3d,
fs.position3d,
fs.is_indoor as isIndoor,
frs.name riskSourceName
FROM
f_fire_station fs
left join f_risk_source frs on frs.id = fs.risk_source_id
WHERE
1=1
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%'
</if>
LIMIT ${start},${length} ;
</select>
<select id="queryForList" resultType="java.util.Map">
SELECT
*
FROM
f_fire_station fs
WHERE
1=1
<if test="name!=null">
AND fs.name LIKE '%${name}%'
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%';
</if>
</select>
<select id="queryEquipCountById" resultType="java.util.Map">
SELECT
fe.`name`,
SUM(fse.number) count,
fe.unit
FROM
`f_fire_station_equipment` fse
LEFT JOIN f_fire_equipment fe ON fe.id = fse.fire_equipment_id
WHERE
fire_station_id = #{id}
GROUP BY
fe.`name`,fe.unit
</select>
<?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.yeejoin.amos.fas.business.dao.mapper.FireStationMapper">
<select id="queryOne" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.address,
fs.floor3d,
fs.position3d,
fs.is_indoor AS isIndoor,
fs.picture,
fs.risk_source_id as riskSourceId
FROM
f_fire_station fs
WHERE
fs.id = ${id}
</select>
<select id="queryCountForFireEqumntPage" resultType="long">
SELECT
count(1)
FROM
f_fire_station_equipment fs
JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id
WHERE
fs.fire_station_id = ${fireStationId}
</select>
<select id="queryForFireEqumntPage" resultType="java.util.Map">
SELECT
fs.fire_station_id,
fs.number numberInStation,
fs.unit unitInStation,
f.*,
frs.name riskSourceName
FROM
f_fire_station_equipment fs
left join f_fire_equipment f ON fs.fire_equipment_id = f.id
left join f_risk_source frs on frs.id = f.risk_source_id
WHERE
fs.fire_station_id = ${fireStationId}
and f.id is not null
LIMIT ${start}, ${length};
</select>
<select id="queryCountForPage" resultType="long">
SELECT
COUNT(1)
FROM
f_fire_station fs
WHERE
1=1
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%';
</if>
</select>
<select id="queryForPage" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.address,
fs.floor3d,
fs.position3d,
fs.is_indoor as isIndoor,
frs.name riskSourceName
FROM
f_fire_station fs
left join f_risk_source frs on frs.id = fs.risk_source_id
WHERE
1=1
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%'
</if>
LIMIT ${start},${length} ;
</select>
<select id="queryForList" resultType="java.util.Map">
select
bu.id,
bu .name,
'1' as type
from
wl_building as bu
left join wl_equipment_category as cat on bu.equipment_code = cat.id
where substr(cat.code ,1,4) = '9301'
<if test="name!=null">
AND fs.name LIKE '%${name}%'
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%';
</if>
</select>
<select id="queryEquipCountById" resultType="java.util.Map">
SELECT
fe.`name`,
SUM(fse.number) count,
fe.unit
FROM
`f_fire_station_equipment` fse
LEFT JOIN f_fire_equipment fe ON fe.id = fse.fire_equipment_id
WHERE
fire_station_id = #{id}
GROUP BY
fe.`name`,fe.unit
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment