<?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="io.renren.modules.app.dao.XlkDao">
    <select id="selectxlkxq" resultType="io.renren.modules.app.entity.XlkEntity">
    select xqmc,xqbm,gzdbm from xqxx where 1=1 
    <if test=" _pt!=null and _pt!=''">
			and xqmc like '%${_pt}%' or xqbm like '%${_pt}%'
	</if>
    </select>
    
    <select id="selectxm" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select xmmc,xmbm,kfskm from xm where xqbm=#{bm}
    </select>
    
    <select id="selectjzszkm" resultType="io.renren.modules.app.entity.XlkEntity">
     select km,kmmc from h_km where kmlbbm='7'
    </select>
    
    <select id="selectlz" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select dhbm,dhmc,lcs,drs from zhxx where xmbm=#{bm}
    </select>
    
    <select id="selectkmlb" resultType="io.renren.modules.app.entity.XlkEntity">
    select kmlbbm,kmlbmc,pydm from h_kmlb where 1=1
    </select>
    
    <select id="selectkmlbbyid" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select kmlbbm,kmlbmc,pydm from h_kmlb where kmlbbm=#{id}
    </select>
    
    <select id="selectpzh" resultType="io.renren.modules.app.entity.XlkEntity">
    select DISTINCT pzh from h_pz where 1=1
    </select>
    
    <select id="selectfwxz" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
   SELECT value,id FROM sys_dict where type=#{type} order by order_num
    </select>
    
    <select id="selectkm" resultType="io.renren.modules.app.entity.XlkEntity">
    select km,kmmc,pydm from h_km where 1=1
    </select>
    
    <select id="selectkmmc" resultType="io.renren.modules.app.entity.XlkEntity">
    select kmmc from h_km where km=#{id}
    </select>
    
    <select id="selectdwjjl"  parameterType="java.util.Map"  resultType="io.renren.modules.app.entity.XlkEntity">
     SELECT mc,dwjjl ftbz FROM JKBZ WHERE 1=1 
     <if test=" fwyt !=null and fwyt !='' ">
     AND  FWYT = #{fwyt}
	 </if>
	 <if test=" jsbz !=null and jsbz !='' ">
     AND JSBZ = #{jsbz}
	 </if>
     ORDER BY BM 
     </select>
    
    
    <!-- 项目下拉框 -->
   	<select id="selectXMxlk" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
   		select xmbm,xmmc from xm where 1=1 
   		<if test=" _pt!=null and _pt!=''">
			and xm.xmmc like '%${_pt}%' or xm.xmbm like '%${_pt}%'
		</if>
   	</select>
   	
   	<!-- 项目下拉框2 根据小区编码查询-->
   	<select id="selectXMxlk2" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
   		select xmbm,xmmc from xm where 1=1 
   		<if test=" _pt!=null and _pt!=''">
			and xm.xmmc like '%${_pt}%' or xm.xqbm like '%${_pt}%'
		</if>
   	</select>
	
	<!-- 幢号信息下拉框 -->
	<select id="selectZHxlk" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
	select dhbm,dhmc from zhxx where xmbm = #{xmbm} ORDER BY dhbm 
	</select>
	
	<!-- 门牌号下拉框 -->
	<select id="selectMPHxlk" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
	select fwbm,mphm,xm,fpbh from fwxx where dhbm = #{dhbm}
	</select>
	
	<!-- 门牌号下拉框根据mh查询 -->
	<select id="selectMPHxlk2" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
	select fwbm,mphm,xm,fpbh from fwxx where mh = #{mh}
	</select>
	
	<!-- 单元下拉框 -->
	<select id="selectDYxlk" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
		SELECT fwdybm,dymc,dyh,dhbm from dyxx where dhbm = #{dhbm} 
		order by dyh 
	</select>
	
	<!-- 开发单位下拉框 -->
	<select id="selectKFDWxlk" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
		select dwbm,dwmc from sfdw where 1=1 
		<if test=" _pt!=null and _pt!=''">
			and dwmc like '%${_pt}%' or dwbm like '%${_pt}%'
		</if>
	</select>
	
	<!-- 物业公司下拉框 -->
	<select id="selectwygs" parameterType="io.renren.modules.app.entity.WygsxxEntity" resultType="io.renren.modules.app.entity.WygsxxEntity">
		select wygsbm,wygsmc from wygsxx
	</select>
	
	<!-- 管委会下拉框 -->
	<select id="selectgwhxx" parameterType="io.renren.modules.app.entity.GwhxxEntity" resultType="io.renren.modules.app.entity.GwhxxEntity">
		select gwhbm,gwhmc from gwhxx
	</select>
	
	<select id="selectkjqj" resultType="io.renren.modules.app.entity.XlkEntity">
		select dqkjqj from xtcs where 1=1
	</select>
	
	<select id="selectczyy" resultType="io.renren.modules.app.entity.XlkEntity">
    select czbm,czyy from czyy where 1=1
    </select>
    
     <select id="selectcwkjqj" resultType="io.renren.modules.app.entity.XlkEntity">
    select kjqj dqkjqj from h_zt where 1=1
    </select>
    
    <select id="selectjxmall" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select xmmc,xmbm,kfskm,dwbm from xm where 1=1 
    <if test=" _pt!=null and _pt!=''">
			and xmmc like '%${_pt}%'
	</if>
    </select>
    
    <select id="selectDWBYXM" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select s.dwmc,s.dwbm from xm x,sfdw s where s.dwbm=x.dwbm and x.xmbm=#{id}
    </select>
    
    <select id="selectDYBMBYXM" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select d.dymc,d.fwdybm,z.dhmc from dyxx d,zhxx z where d.dhbm=z.dhbm and d.dhbm in(select dhbm from zhxx where xmbm=#{id})
    </select>
    
    <select id="selectDYBMBYSQDBH" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select distinct d.dymc,d.fwdybm,z.dhmc from dyxx d,zhxx z,wxjlb w where d.dhbm=z.dhbm and d.dhbm in(select dhbm from wxjlb where sqdbh=#{id})
    </select>
    
    <select id="selectYELDXLK" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select DISTINCT z.dhmc,z.dhbm from zhxx z,ftqc t where z.dhbm=t.dhbm and z.dhbm in(select dhbm from ftqc where sqdbh=#{id})
    </select>
    
    <select id="selectYEDYXLK" parameterType="java.lang.String" resultType="io.renren.modules.app.entity.XlkEntity">
    select DISTINCT d.dymc,d.fwdybm,z.dhmc from fwxx f,dyxx d,zhxx z,ftqc t where f.mh=d.fwdybm and z.dhbm=d.dhbm and f.fwbm in (select fwbm from ftqc where sqdbh=#{id})
    </select>
	
</mapper>