#
18516761980
2022-07-22 b743b62c7d57c84d16422841b0b51e85fe53a891
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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.WorkFileLogDao">
 
<!-- mapper不支持sql语句嵌套时,采用sql片段包含方式,解决xml标签问题 -->
<sql id="workDetailLogConditionSql">    
        <if test="wrk_no!=null and wrk_no!='' ">
            and wrk_no = #{wrk_no}
        </if>
        <if test="io_time!=null and io_time!='' ">
            and io_time = #{io_time}
        </if>
        <if test="matnr!=null and matnr!='' ">
            and (a.matnr like '%' + #{matnr} + '%'
            or maktx like '%' + #{matnr} + '%'
            or lgnum like '%' + #{matnr} + '%'
            or tbnum like '%' + #{matnr} + '%'
            or tbpos like '%' + #{matnr} + '%'
            or zmatid like '%' + #{matnr} + '%'
            or werks like '%' + #{matnr} + '%'
            or anfme like '%' + #{matnr} + '%'
            or altme like '%' + #{matnr} + '%'
            or zpallet like '%' + #{matnr} + '%'
            or bname like '%' + #{matnr} + '%'
            )
        </if>        
</sql>
 
<select id="queryWorkDetailLogList" parameterType="com.slcf.bean.WorkDetailLogCondition" resultType="com.slcf.pojo.WorkDetailLogBean">
select * from ( 
select a.*,ROW_NUMBER() OVER(Order by wrk_no,a.matnr) as rowid
 from asr_wrk_detl_log a
<where>
    1=1
     <include refid="workDetailLogConditionSql"></include>
</where>
 ) as a
<where>
    rowid between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
    <![CDATA[
        order by a.wrk_no,a.matnr asc
    ]]>
</where>
</select>
 
<select id="getWorkDetailLogCount" parameterType="com.slcf.bean.WorkDetailLogCondition"    resultType="Integer">
select count(1) from asr_wrk_detl_log a
<where>
<![CDATA[
    1=1
]]>
<include refid="workDetailLogConditionSql"></include>
</where>
</select>
</mapper>