<?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.huazheng.project.mssql4.mapper.UltimusDBMapper">
    
    <select id="selectTasksNew" parameterType="Tasks" resultType="Tasks">
		select top 20 a.* from (
			select ROW_NUMBER() OVER(ORDER BY taskid) as rowids, 
				RTRIM(taskId) as taskId, RTRIM(processName) as processName, incident, startTime, 
				SUBSTRING (taskUser,9,8) as taskUser
			from tasks 
			where RTRIM(processName) = '样品结案流程' and LEN(taskUser) = 16
		) a where a.rowids &gt; #{rowids}
    </select>
    
    <select id="selectTasksById" parameterType="Tasks" resultType="Tasks">
    	SELECT RTRIM(taskId) as taskId, RTRIM(processName) as processName, incident, startTime, SUBSTRING(taskUser,9,8) as taskUser
		from tasks where RTRIM(taskId) = #{taskId}
    </select>
    
</mapper>
