|
|
|
|
<?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.hisense.hiatmp.server_api.mapper.ThtTricycleInfoBaseMapper">
|
|
|
|
|
|
|
|
|
|
<select id="getTricycleList" resultType="com.hisense.hiatmp.model.common.VO.TricycleListVO">
|
|
|
|
|
select ttib.id,
|
|
|
|
|
ttib.*
|
|
|
|
|
,jd.jdname,sq.sqname
|
|
|
|
|
from
|
|
|
|
|
tht_tricycle_info_base ttib
|
|
|
|
|
|
|
|
|
|
left join (
|
|
|
|
|
select distinct jdcode,jdname from
|
|
|
|
|
tlv_street_community
|
|
|
|
|
) jd on jd.jdcode=ttib.street_community
|
|
|
|
|
left join (
|
|
|
|
|
select distinct sqcode,sqname from
|
|
|
|
|
tlv_street_community
|
|
|
|
|
) sq on sq.sqcode=ttib.village_community
|
|
|
|
|
where
|
|
|
|
|
1 = 1
|
|
|
|
|
<if test="roleFlag == 1">
|
|
|
|
|
-- 村干部权限
|
|
|
|
|
and ttib.village_community = #{cdepartmentid}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="roleFlag == 2">
|
|
|
|
|
-- 中队民警权限
|
|
|
|
|
and ttib.street_community in
|
|
|
|
|
(
|
|
|
|
|
select jdcode from tlv_street_community
|
|
|
|
|
where zdcode = #{cdepartmentid}
|
|
|
|
|
or xqcode = #{cdepartmentid}
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != 0">
|
|
|
|
|
-- 0 全部 1 已补录 2 未补录
|
|
|
|
|
AND ttib.status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="search != null and search != ''">
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
ttib.vehicle_license like concat(concat('%',#{search}),'%')
|
|
|
|
|
OR ttib.driver_name like concat(concat('%',#{search}),'%')
|
|
|
|
|
OR jd.jdname like concat(concat('%',#{search}),'%')
|
|
|
|
|
OR sq.sqname like concat(concat('%',#{search}),'%')
|
|
|
|
|
OR ttib.driver_phone like concat(concat('%',#{search}),'%')
|
|
|
|
|
OR ttib.driver_address like concat(concat('%',#{search}),'%')
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
Order by
|
|
|
|
|
ttib.driver_name COLLATE "zh_CN.utf8" ASC
|
|
|
|
|
</select>
|
|
|
|
|
<!-- <select id="getTricycleList" resultType="com.hisense.hiatmp.model.common.VO.TricycleListVO">-->
|
|
|
|
|
<!-- select DISTINCT ttib.id,-->
|
|
|
|
|
<!-- ttib.*-->
|
|
|
|
|
<!-- from-->
|
|
|
|
|
<!-- tht_tricycle_info_base ttib-->
|
|
|
|
|
<!-- <if test="roleFlag == 1">-->
|
|
|
|
|
<!---- 村干部权限-->
|
|
|
|
|
<!-- INNER JOIN tlv_street_community tsc on tsc.sqcode = #{cdepartmentid}-->
|
|
|
|
|
<!-- and ttib.village_community = tsc.sqcode-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<!-- <if test="roleFlag == 2">-->
|
|
|
|
|
<!---- 中队民警权限-->
|
|
|
|
|
<!-- INNER JOIN tlv_street_community tsc on tsc.zdcode = #{cdepartmentid}-->
|
|
|
|
|
<!-- and ttib.village_community = tsc.sqcode-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<!-- where-->
|
|
|
|
|
<!-- 1 = 1-->
|
|
|
|
|
<!-- <if test="status != 0">-->
|
|
|
|
|
<!---- 0 全部 1 已补录 2 未补录-->
|
|
|
|
|
<!-- AND ttib.status = #{status}-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<!-- <if test="search != null and search != ''">-->
|
|
|
|
|
<!-- AND ttib.vehicle_license like concat(concat('%',#{search}),'%')-->
|
|
|
|
|
<!-- </if>-->
|
|
|
|
|
<!-- </select>-->
|
|
|
|
|
|
|
|
|
|
<select id="getTricycleInfoBaseById" resultType="com.hisense.hiatmp.model.common.DTO.ThtTricycleInfoBaseDTO">
|
|
|
|
|
select * from tht_tricycle_info_base where vehicle_id = #{vehicleId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|