<?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.ruoyi.zzb.zdcx.mapper.ZdcxMapper">

	<!--<resultMap id="ZdcxResultMap" type="Zdcx" >
		<id property="id" jdbcType="VARCHAR" column="id"/>
		<result property="docId" jdbcType="VARCHAR" column="DOC_ID"/>
		<result property="title" jdbcType="VARCHAR" column="TITLE"/>
		<result property="content" jdbcType="VARCHAR" column="CONTENT"/>
		<result property="publishDept" jdbcType="VARCHAR" column="PUBLISH_DEPT"/>
		<result property="createTime" jdbcType="VARCHAR" column="CREATE_TIME"/>
		<result property="createDeptCode" jdbcType="VARCHAR" column="CREATE_DEPT_CODE"/>
		<result property="createDeptName" jdbcType="VARCHAR" column="CREATE_DEPT_NAME"/>
		<result property="createParentDeptName" jdbcType="VARCHAR" column="CREATE_PARENT_DEPT_NAME"/>
		<result property="createParentDeptCode" jdbcType="VARCHAR" column="CREATE_PARENT_DEPT_CODE"/>
		<result property="createUserId" jdbcType="VARCHAR" column="CREATE_USER_ID"/>
		<result property="createUserName" jdbcType="VARCHAR" column="CREATE_USER_NAME"/>
		<result property="createUserPoliceNo" jdbcType="VARCHAR" column="CREATE_USER_POLICE_NO"/>
		<result property="isDelete" jdbcType="INTEGER" column="IS_DELETE"/>
		<result property="flag" jdbcType="INTEGER" column="FLAG"/>
	</resultMap>

	<select id="getDataByPage" parameterType="Zdcx" resultMap="ZdcxResultMap">
		select * from (select t.*, rownum rownum_ from (select DOC_ID, TITLE, PUBLISH_DEPT, CONTENT, CREATE_TIME from 'STANDARD_DOC_INFO'
		<where>
		    1 = 1
			<if test="queryFlag == 0 and docId != null">
				and docId = #{docId}
			</if>
			<if test="queryFlag == 1 and docId != null">
				or docId = #{docId}
			</if>
			<if test="queryFlag == 0 and title != null">
				and title = #{title}
			</if>
			<if test="queryFlag == 1 and title != null">
				or title = #{title}
			</if>
			<if test="queryFlag == 0 and publishDept != null">
				and publishDept = #{publishDept}
			</if>
			<if test="queryFlag == 1 and publishDept != null">
				or publishDept = #{publishDept}
			</if>
			<if test="queryFlag == 0 and content != null">
				and content like #{content}
			</if>
			<if test="queryFlag == 1 and content != null">
				or content like #{content}
			</if>
		</where>
		) t where rownum <= #{pageNo} * #{pageSize}) a where rownum_ > ( #{pageNo} - 1) * #{pageSize}
	</select>

	<select id="getDataCount" parameterType="Map" resultType="Long">
		select count(*) from 'STANDARD_DOC_INFO'
		<where>
			1 = 1
			<if test="queryFlag == 0 and docId != null">
				and docId = #{docId}
			</if>
			<if test="queryFlag == 1 and docId != null">
				or docId = #{docId}
			</if>
			<if test="queryFlag == 0 and title != null">
				and title = #{title}
			</if>
			<if test="queryFlag == 1 and title != null">
				or title = #{title}
			</if>
			<if test="queryFlag == 0 and publishDept != null">
				and publishDept = #{publishDept}
			</if>
			<if test="queryFlag == 1 and publishDept != null">
				or publishDept = #{publishDept}
			</if>
			<if test="queryFlag == 0 and content != null">
				and content like #{content}
			</if>
			<if test="queryFlag == 1 and content != null">
				or content like #{content}
			</if>
		</where>
	</select>-->

</mapper>