gongbx
6 months ago
14 changed files with 90 additions and 89 deletions
@ -1,71 +1,53 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?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"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.nl.wms.database.eas.dao.mapper.AllocationBillMapper"> |
<mapper namespace="org.nl.wms.database.eas.dao.mapper.AllocationBillMapper"> |
||||
<select id="allocationPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery"> |
<select id="getAllocationCount" resultType="java.lang.Long"> |
||||
WITH ranked_data AS ( |
WITH ranked_data AS ( SELECT t.*, ROW_NUMBER ( ) OVER ( PARTITION BY djbh ORDER BY CJSJ DESC ) AS rn FROM |
||||
SELECT |
EAS_NOBLE.V_UC_STOCKTRANSFERBILL t ), |
||||
t.*, |
grouped_data AS ( SELECT * FROM ranked_data WHERE rn = 1 ) SELECT |
||||
ROW_NUMBER() OVER (PARTITION BY djbh ORDER BY jhdrrq DESC) AS rn |
COUNT( 1 ) |
||||
FROM |
|
||||
EAS_NOBLE.V_UC_STOCKTRANSFERBILL t |
|
||||
), |
|
||||
grouped_data AS ( |
|
||||
SELECT * |
|
||||
FROM |
FROM |
||||
ranked_data |
( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data |
||||
WHERE |
<if test="fuzzy != null and fuzzy != ''"> |
||||
rn = 1 |
WHERE (wlmc LIKE '%' || #{fuzzy} || '%' |
||||
) |
OR djbh LIKE '%' || #{fuzzy} || '%' |
||||
SELECT * |
OR wlbm LIKE '%' || #{fuzzy} || '%' |
||||
FROM ( |
OR wlmc LIKE '%' || #{fuzzy} || '%' |
||||
SELECT |
OR dckcmc LIKE '%' || #{fuzzy} || '%' |
||||
temp.*, |
OR dcckmc LIKE '%' || #{fuzzy} || '%' |
||||
ROWNUM AS row_num |
OR drkcmc LIKE '%' || #{fuzzy} || '%' |
||||
FROM ( |
) |
||||
SELECT * |
</if> |
||||
FROM grouped_data |
ORDER BY CJSJ DESC ) temp ) |
||||
WHERE |
</select> |
||||
|
<select id="allocationPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery"> |
||||
|
WITH ranked_data AS ( SELECT t.*, ROW_NUMBER ( ) OVER ( PARTITION BY djbh ORDER BY CJSJ DESC ) AS rn FROM |
||||
|
EAS_NOBLE.V_UC_STOCKTRANSFERBILL t ), |
||||
|
grouped_data AS ( SELECT * FROM ranked_data WHERE rn = 1 ) SELECT * FROM |
||||
|
( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data |
||||
<if test="fuzzy != null and fuzzy != ''"> |
<if test="fuzzy != null and fuzzy != ''"> |
||||
(djbh LIKE '%' || #{fuzzy} || '%' OR |
WHERE (wlmc LIKE '%' || #{fuzzy} || '%' |
||||
wlbm LIKE '%' || #{fuzzy} || '%' OR |
OR djbh LIKE '%' || #{fuzzy} || '%' |
||||
wlmc LIKE '%' || #{fuzzy} || '%' OR |
OR wlbm LIKE '%' || #{fuzzy} || '%' |
||||
ggxh LIKE '%' || #{fuzzy} || '%' OR |
OR wlmc LIKE '%' || #{fuzzy} || '%' |
||||
dckcmc LIKE '%' || #{fuzzy} || '%' OR |
OR dckcmc LIKE '%' || #{fuzzy} || '%' |
||||
dcckmc LIKE '%' || #{fuzzy} || '%' OR |
OR dcckmc LIKE '%' || #{fuzzy} || '%' |
||||
drkcmc LIKE '%' || #{fuzzy} || '%' OR) |
OR drkcmc LIKE '%' || #{fuzzy} || '%' |
||||
|
) |
||||
</if> |
</if> |
||||
ORDER BY jhdrrq DESC |
ORDER BY CJSJ DESC ) temp WHERE <![CDATA[ ROWNUM <= #{size} * #{page} ]]>) WHERE |
||||
) temp |
<![CDATA[ row_num > #{size} * (#{page} - 1) ]]> |
||||
WHERE |
|
||||
<![CDATA[ ROWNUM <= #{size} * #{page} ]]> |
|
||||
) |
|
||||
WHERE <![CDATA[ row_num > #{size} * (#{page} - 1) ]]> |
|
||||
</select> |
</select> |
||||
|
|
||||
|
|
||||
<select id="allocationDetailPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery"> |
<select id="allocationDetailPage" resultType="org.nl.wms.database.eas.dto.AllocationBillQuery"> |
||||
SELECT * |
SELECT * FROM ( |
||||
FROM EAS_NOBLE.allocation |
SELECT V.*, ROW_NUMBER() OVER (ORDER BY V.CJSJ DESC) AS RNUM |
||||
WHERE DJBH = #{djbh} |
FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL V |
||||
<!-- <if test="fuzzy != null and fuzzy != ''">--> |
WHERE V.DJBH = #{djbh} |
||||
<!-- AND (--> |
) |
||||
<!-- djbh LIKE CONCAT('%', #{fuzzy}, '%')--> |
WHERE RNUM BETWEEN (#{page} - 1) * #{size} + 1 AND #{page} * #{size} |
||||
<!-- OR wlmc LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR ggxh LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR fzsl LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR jldw LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR sl LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR kclx LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR kczt LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR dcck LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR dccw LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR drck LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR drcw LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR trackno LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR ywrq LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- OR bz LIKE CONCAT('%', #{fuzzy}, '%')--> |
|
||||
<!-- )--> |
|
||||
<!-- </if>--> |
|
||||
ORDER BY djbh ASC |
|
||||
</select> |
</select> |
||||
|
|
||||
|
|
||||
</mapper> |
</mapper> |
||||
|
Loading…
Reference in new issue