<?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.artfess.base.dao.CommonDao">
	<select id="query" parameterType="java.util.Map" resultType="java.util.HashMap">
		${sql} 
	</select>
	
	<select id="queryByPage" parameterType="java.util.Map" resultType="java.util.HashMap">
		${sql} 
	</select>
	
	<select id="queryByQueryFilter" parameterType="java.util.Map" resultType="java.util.HashMap">
		${sql} ${ew.customSqlSegment}
	</select>

	<select id="queryByCustomSql" parameterType="java.util.Map" resultType="java.util.HashMap">
		${sql} 
	    <if test="@com.artfess.base.ognl.Ognl@containsWhere(sql) and  @com.artfess.base.ognl.Ognl@isNotEmpty(@com.artfess.base.ognl.Ognl@withOutWhere(@com.artfess.base.ognl.Ognl@insertBeforeOrderBy(ew.customSqlSegment,ew.paramNameValuePairs.filterSql)))">
			and ${@com.artfess.base.ognl.Ognl@withOutWhere( @com.artfess.base.ognl.Ognl@insertBeforeOrderBy(ew.customSqlSegment,ew.paramNameValuePairs.filterSql))}
		</if>
		<if test="!@com.artfess.base.ognl.Ognl@containsWhere(sql)">
			${@com.artfess.base.ognl.Ognl@insertBeforeOrderBy(ew.customSqlSegment,ew.paramNameValuePairs.filterSql)}
		</if>
	</select>
	
</mapper>