<?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.huatek.frame.base.mapper.AreaMapper"> 

	<sql id="Base_Column_List">
		parent as parent,
		code as code,
		deleted as deleted,
		province as province,
		city as city,
		district as district,
		id as id
	</sql>

	<select id="selectAreaPage" parameterType="com.huatek.frame.base.dto.AreaDTO" resultType="com.huatek.frame.base.vo.AreaVO">
		select
			<include refid="Base_Column_List" />
		from
			sys_area
		where
			deleted=#{deleted}
		<if test="code != null and   code != ''">
			and code like concat('%',#{code},'%')
		</if>
		<if test="province != null and province != ''">
			and province like concat('%',#{province},'%')
		</if>
		<if test="city != null and   city != ''">
			and city like concat('%',#{city},'%')
		</if>
		<if test="district != null and   district != ''">
			and district like concat('%',#{district},'%')
		</if>
	</select>

</mapper>