王佳豪
2021-07-14 0142e910dffd0255a4a4a1192cedd2ba0b0e71ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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.slcf.dao.ReportQueryDao">
 
<!-- mapper不支持sql语句嵌套时,采用sql片段包含方式,解决xml标签问题 -->
<sql id="viewLocMapConditionSql">    
        <if test="row1!=null and row1!='' ">
            and left(rowlev,2) like '%' + #{row1} + '%'
        </if>
</sql>
 
<!-- 入库统计 -->
<!-- 分页查询所有信息 -->
<select id="queryViewLocMapList" parameterType="com.slcf.pojo.ViewLocMapBean" resultType="com.slcf.pojo.ViewLocMapBean">
select top (#{pageSize}) * from asr_loc_map_view 
<where>
    rowlev not in (select top ((#{pageNumber}-1)*#{pageSize}) rowlev from asr_loc_map_view 
    <where>
        1=1
        <include refid="viewLocMapConditionSql"></include>        
    </where>
    order by rowlev asc)
    <include refid="viewLocMapConditionSql"></include>
    <![CDATA[
        order by rowlev asc
    ]]>
</where>
</select>
 
<select id="getViewLocMapCount" parameterType="com.slcf.pojo.ViewLocMapBean"    resultType="Integer">
select count(1) from asr_loc_map_view a
<where>
<![CDATA[
    1=1
]]>
<include refid="viewLocMapConditionSql"></include>
</where>
</select>
 
</mapper>