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

	<!-- 可根据自己的需求，是否要使用 -->
	<resultMap type="io.renren.modules.app.entity.HZyEntity" id="hZyMap">
		<result property="zybm" column="zybm" />
		<result property="zymc" column="zymc" />
		<result property="pydm" column="pydm" />
		<result property="ztbm" column="ztbm" />
	</resultMap>

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

		select * from h_zy where 1=1

		<if test=" zybm!=null and zybm!='' ">
			and zybm like CONCAT(#{zybm},"%")
		</if>
		<if test=" zymc!=null and zymc!='' ">
			and zymc like CONCAT(#{zymc},"%")
		</if>
		<if test=" pydm!=null and pydm!='' ">
			and pydm like CONCAT(#{pydm},"%")
		</if>
		<if test=" ztbm!=null and ztbm!='' ">
			and ztbm like CONCAT(#{ztbm},"%")
		</if>
		order by zybm desc

	</select>

	<select id="selectzy" parameterType="io.renren.modules.app.entity.HZyEntity"
		resultType="io.renren.modules.app.entity.HZyEntity">

		select * from h_pz where zymc=#{zymc}
	</select>


</mapper>