You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.9 KiB
79 lines
2.9 KiB
<?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.* |
|
<if test="roleFlag != 3"> |
|
,jd.jdname,sq.sqname |
|
</if> |
|
from |
|
tht_tricycle_info_base ttib |
|
<if test="roleFlag != 3"> |
|
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 |
|
</if> |
|
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}),'%') |
|
</if> |
|
</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> |