<?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="org.springblade.modules.equipage.mapper.GunMapper">
|
|
<!--枪支分页信息-->
|
<select id="selectGunPage" resultType="org.springblade.modules.equipage.vo.GunVo">
|
SELECT
|
sg.*,bt.dept_name AS tenantName
|
FROM
|
sys_gun sg
|
LEFT JOIN
|
blade_dept bt
|
ON
|
sg.dept_id = bt.id
|
WHERE
|
1=1
|
<if test="gun.tenantName!=null and gun.tenantName!=''">
|
and bt.dept_name like concat('%', #{gun.tenantName},'%')
|
</if>
|
<if test="gun.deptId!=null and gun.deptId!=''">
|
and sg.dept_id = #{gun.deptId}
|
</if>
|
<if test="gun.gunCardNumber!=null and gun.gunCardNumber!=''">
|
and sg.gun_card_number like concat('%', #{gun.gunCardNumber},'%')
|
</if>
|
<if test="gun.cardNumber!=null and gun.cardNumber!=''">
|
and sg.card_number like concat('%', #{gun.cardNumber},'%')
|
</if>
|
<if test="gun.issueUnit!=null and gun.issueUnit!=''">
|
and sg.issue_unit like concat('%', #{gun.issueUnit},'%')
|
</if>
|
<if test="gun.personInCharge!=null and gun.personInCharge!=''">
|
and sg.person_in_charge like concat('%', #{gun.personInCharge},'%')
|
</if>
|
</select>
|
|
<!--枪支详情信息-->
|
<select id="selectGunInfo" resultType="org.springblade.modules.equipage.vo.GunVo">
|
SELECT
|
sg.*,bt.dept_name AS tenantName
|
FROM
|
sys_gun sg
|
LEFT JOIN
|
blade_dept bt
|
ON
|
sg.dept_id = bt.id
|
WHERE
|
1=1
|
<if test="gun.id!=null">
|
and sg.id = #{gun.id}
|
</if>
|
</select>
|
|
<!--查询枪支数据-->
|
<select id="getGunList" resultType="org.springblade.modules.equipage.vo.GunVo">
|
SELECT
|
sg.*,bt.dept_name AS tenantName,sll.longitude jd,sll.latitude wd,sll.record_time recordTime
|
FROM
|
sys_gun sg
|
LEFT JOIN
|
blade_dept bt
|
ON
|
sg.dept_id = bt.id
|
left join
|
sys_live_location sll
|
on
|
sll.worker_id = sg.id
|
WHERE
|
1=1
|
and type = 3
|
<if test="gun.tenantName!=null and gun.tenantName!=''">
|
and bt.dept_name like concat('%', #{gun.tenantName},'%')
|
</if>
|
<if test="gun.deptId!=null and gun.deptId!=''">
|
and sg.dept_id = #{gun.deptId}
|
</if>
|
<if test="gun.gunCardNumber!=null and gun.gunCardNumber!=''">
|
and sg.gun_card_number like concat('%', #{gun.gunCardNumber},'%')
|
</if>
|
<if test="gun.cardNumber!=null and gun.cardNumber!=''">
|
and sg.card_number like concat('%', #{gun.cardNumber},'%')
|
</if>
|
<if test="gun.issueUnit!=null and gun.issueUnit!=''">
|
and sg.issue_unit like concat('%', #{gun.issueUnit},'%')
|
</if>
|
<if test="gun.personInCharge!=null and gun.personInCharge!=''">
|
and sg.person_in_charge like concat('%', #{gun.personInCharge},'%')
|
</if>
|
</select>
|
</mapper>
|