<?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.HKmDao">

	<!-- 可根据自己的需求，是否要使用 -->
	<resultMap type="io.renren.modules.app.entity.HKmEntity" id="hKmMap">
		<result property="km" column="km" />
		<result property="kmmc" column="kmmc" />
		<result property="pydm" column="pydm" />
		<result property="kmlbbm" column="kmlbbm" />
		<result property="kmsx" column="kmsx" />
		<result property="djkm" column="djkm" />
		<result property="jbh" column="jbh" />
		<result property="ztbm" column="ztbm" />
		<result property="gzdbm" column="gzdbm" />
		<result property="pageCount" column="page_count" />
		<result property="pageCount1" column="page_count1" />
	</resultMap>

	<select id="queryByPage" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">

		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where LENGTH(km)=3 and ztbm='0002'

		<if test=" km!=null and km!='' ">
			and km like CONCAT(#{km},"%")
		</if>
		<if test=" kmmc!=null and kmmc!='' ">
			and kmmc like CONCAT(#{kmmc},"%")
		</if>
		<if test=" pydm!=null and pydm!='' ">
			and pydm like CONCAT(#{pydm},"%")
		</if>
		<if test=" kmlbbm!=null and kmlbbm!='' ">
			and kmlbbm like CONCAT(#{kmlbbm},"%")
		</if>
		<if test=" kmsx!=null and kmsx!='' ">
			and kmsx like CONCAT(#{kmsx},"%")
		</if>
		<if test=" djkm!=null and djkm!='' ">
			and djkm like CONCAT(#{djkm},"%")
		</if>
		<if test=" jbh!=null and jbh!='' ">
			and jbh like CONCAT(#{jbh},"%")
		</if>
		<if test=" ztbm!=null and ztbm!='' ">
			and ztbm like CONCAT(#{ztbm},"%")
		</if>
		<if test=" gzdbm!=null and gzdbm!='' ">
			and gzdbm like CONCAT(#{gzdbm},"%")
		</if>
		<if test=" pageCount!=null and pageCount!='' ">
			and page_count like CONCAT(#{pageCount},"%")
		</if>
		<if test=" pageCount1!=null and pageCount1!='' ">
			and page_count1 like CONCAT(#{pageCount1},"%")
		</if>

	</select>

	<select id="selectejcd" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where
		LENGTH(km)=3 and ztbm='0002'
	</select>
	
	<select id="selectejcd2" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where
		LENGTH(km)=4 and ztbm='0003'
	</select>

	<select id="selectsjcd102" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '101%' and LENGTH(km)=6 and ztbm='0002'
	</select>
	
	<select id="selectsjcd1022" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '1001%' and LENGTH(km)=6 and ztbm='0003'
	</select>
	
	<select id="selectsjcd10222" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '3001%' and LENGTH(km)=6 and ztbm='0003'
	</select>
	
	<select id="selectsjcd102222" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE  concat(#{km},'%') and LENGTH(km)=6 and ztbm='0003'
	</select>

	<select id="selectsjcd110" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '201%' and LENGTH(km)=6 and ztbm='0002'
	</select>

	<select id="selectsjcd207" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '311%' and LENGTH(km)=6 and ztbm='0002'
	</select>

	<select id="selectsjcd211" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '401%' and LENGTH(km)=6 and ztbm='0002'
	</select>
	
	<select id="selectsjcd411" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km
		LIKE '411%' and LENGTH(km)=6 and ztbm='0002'
	</select>
	
	<select id="select4ji" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km LIKE CONCAT(#{km},"%") and LENGTH(km)=9 and ztbm='0002'
	</select>
	
	<select id="select4ji6" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km=#{km} and ztbm='0002'
	</select>
	
	<select id="select4ji2" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km LIKE CONCAT(#{km},"%") and LENGTH(km)=8 and ztbm='0003'
	</select>
	
	<select id="select4ji62" parameterType="io.renren.modules.app.entity.HKmEntity"
		resultType="io.renren.modules.app.entity.HKmEntity">
		select km,kmmc,pydm,kmlbbm,kmsx,djkm,jbh from h_km where km=#{km} and ztbm='0003'
	</select>


</mapper>