|
|
@ -12,7 +12,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b' and zt>=11
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N' and zt>=11
|
|
|
|
group by
|
|
|
|
group by
|
|
|
|
MONTH(CAST(jssj AS DATE))
|
|
|
|
MONTH(CAST(jssj AS DATE))
|
|
|
|
order by
|
|
|
|
order by
|
|
|
@ -22,7 +22,7 @@
|
|
|
|
<select id="getEveryKw" resultType="java.util.Map">
|
|
|
|
<select id="getEveryKw" resultType="java.util.Map">
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
zt,SUBSTRING(tzbh,6,1) kw
|
|
|
|
zt,SUBSTRING(tzbh,6,1) kw
|
|
|
|
from dm_ydjh WHERE zt>=11 and jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
from dm_ydjh WHERE zt>=11 and jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getZjjhByUserCode" resultType="com.dsic.gj_erp.bean.jhgk.DmYdjh">
|
|
|
|
<select id="getZjjhByUserCode" resultType="com.dsic.gj_erp.bean.jhgk.DmYdjh">
|
|
|
@ -32,7 +32,7 @@
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
(slfkry =#{userCode} or pwfkry =#{userCode} or llfkry =#{userCode} or qgfkry =#{userCode} or hxfkry =#{userCode})
|
|
|
|
(slfkry =#{userCode} or pwfkry =#{userCode} or llfkry =#{userCode} or qgfkry =#{userCode} or hxfkry =#{userCode})
|
|
|
|
and jssj between #{from} and #{to} and lx='b'
|
|
|
|
and jssj between #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getSb" resultType="java.util.Map">
|
|
|
|
<select id="getSb" resultType="java.util.Map">
|
|
|
@ -44,7 +44,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
zt>=42 and lx='b' and (hxfkrq=#{day} or qgfkrq=#{day})
|
|
|
|
zt>=42 and lx='b' and ylbs='N' and (hxfkrq=#{day} or qgfkrq=#{day})
|
|
|
|
group by
|
|
|
|
group by
|
|
|
|
hxsb ,qgsb,zt
|
|
|
|
hxsb ,qgsb,zt
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
@ -55,7 +55,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
zt>=42 and lx='b' and (hxsb=#{code} or qgsb=#{code})
|
|
|
|
zt>=42 and lx='b' and ylbs='N' and (hxsb=#{code} or qgsb=#{code})
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
@ -66,7 +66,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
group by
|
|
|
|
group by
|
|
|
|
dc_ch ,dc_pl ,qgfkrq
|
|
|
|
dc_ch ,dc_pl ,qgfkrq
|
|
|
|
order by dc_ch ,dc_pl
|
|
|
|
order by dc_ch ,dc_pl
|
|
|
@ -83,7 +83,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
zt>=2 and jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
zt>=2 and jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
<choose>
|
|
|
|
<choose>
|
|
|
|
<when test="zyq==2">
|
|
|
|
<when test="zyq==2">
|
|
|
|
and (SUBSTRING(tzbh,6,1)=1 or SUBSTRING(tzbh,6,1)=3)
|
|
|
|
and (SUBSTRING(tzbh,6,1)=1 or SUBSTRING(tzbh,6,1)=3)
|
|
|
@ -114,7 +114,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
lx='b' and (slfkrq = #{today} or hxfkrq = #{today} or qgfkrq = #{today})
|
|
|
|
lx='b' and ylbs='N' and (slfkrq = #{today} or hxfkrq = #{today} or qgfkrq = #{today})
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="qfxq" resultType="java.lang.String">
|
|
|
|
<select id="qfxq" resultType="java.lang.String">
|
|
|
@ -145,7 +145,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_sygd_mx xq left join dm_ydjh ydjh on xq.dc_ch =ydjh.dc_ch and xq.dc_pl =ydjh.dc_pl and xq.tzbh =ydjh.tzbh
|
|
|
|
dm_sygd_mx xq left join dm_ydjh ydjh on xq.dc_ch =ydjh.dc_ch and xq.dc_pl =ydjh.dc_pl and xq.tzbh =ydjh.tzbh
|
|
|
|
where
|
|
|
|
where
|
|
|
|
xq.jssj BETWEEN #{from} and #{to} and ydjh.lx='b'
|
|
|
|
xq.jssj BETWEEN #{from} and #{to} and ydjh.lx='b' and ydjh.ylbs='N'
|
|
|
|
) a where a.jhzl!=0
|
|
|
|
) a where a.jhzl!=0
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
@ -157,7 +157,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="zyjhzx" resultType="java.util.Map">
|
|
|
|
<select id="zyjhzx" resultType="java.util.Map">
|
|
|
@ -169,28 +169,28 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
zt >=21 and jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
zt >=21 and jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
UNION ALL
|
|
|
|
UNION ALL
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
'二区' as zyq,tzbh,zt,DATEPART(DD,qgfkrq) as day
|
|
|
|
'二区' as zyq,tzbh,zt,DATEPART(DD,qgfkrq) as day
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
zt >=62 and jssj BETWEEN #{from} and #{to} and zyq1='二区' and lx='b'
|
|
|
|
zt >=62 and jssj BETWEEN #{from} and #{to} and zyq1='二区' and lx='b' and ylbs='N'
|
|
|
|
UNION ALL
|
|
|
|
UNION ALL
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
'三区',tzbh,zt,DATEPART(DD,qgfkrq) as day
|
|
|
|
'三区',tzbh,zt,DATEPART(DD,qgfkrq) as day
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
zt >=62 and jssj BETWEEN #{from} and #{to} and zyq1='三区' and lx='b'
|
|
|
|
zt >=62 and jssj BETWEEN #{from} and #{to} and zyq1='三区' and lx='b' and ylbs='N'
|
|
|
|
UNION ALL
|
|
|
|
UNION ALL
|
|
|
|
SELECT
|
|
|
|
SELECT
|
|
|
|
'四区',tzbh,zt,DATEPART(DD,qgfkrq) as day
|
|
|
|
'四区',tzbh,zt,DATEPART(DD,qgfkrq) as day
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
zt >=62 and jssj BETWEEN #{from} and #{to} and zyq1='四区' and lx='b'
|
|
|
|
zt >=62 and jssj BETWEEN #{from} and #{to} and zyq1='四区' and lx='b' and ylbs='N'
|
|
|
|
) a
|
|
|
|
) a
|
|
|
|
where isnull(a.day,'')!=''
|
|
|
|
where isnull(a.day,'')!=''
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
@ -203,7 +203,7 @@
|
|
|
|
from
|
|
|
|
from
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="xbgtt" resultType="java.util.Map">
|
|
|
|
<select id="xbgtt" resultType="java.util.Map">
|
|
|
@ -211,7 +211,7 @@
|
|
|
|
DISTINCT a.dc_ch dcCh,a.yf,sum(a.zl/1000) over(PARTITION by a.dc_ch,a.yf) zl ,
|
|
|
|
DISTINCT a.dc_ch dcCh,a.yf,sum(a.zl/1000) over(PARTITION by a.dc_ch,a.yf) zl ,
|
|
|
|
sum(CONVERT(decimal,b.bclqzl)/1000) over(PARTITION by b.dc_ch,MONTH(CAST(b.jssj AS DATE))) jhzl
|
|
|
|
sum(CONVERT(decimal,b.bclqzl)/1000) over(PARTITION by b.dc_ch,MONTH(CAST(b.jssj AS DATE))) jhzl
|
|
|
|
from dm_xbjh a left join dm_ydjh b on a.dc_ch =b.dc_ch and
|
|
|
|
from dm_xbjh a left join dm_ydjh b on a.dc_ch =b.dc_ch and
|
|
|
|
CONVERT(int,a.yf)=MONTH(CAST(b.jssj AS DATE)) WHERE a.nf=#{nf} and a.version=#{version}
|
|
|
|
CONVERT(int,a.yf)=MONTH(CAST(b.jssj AS DATE)) WHERE a.nf=#{nf} and a.version=#{version} and b.lx='b' and b.ylbs='N'
|
|
|
|
order by a.dc_ch, a.yf
|
|
|
|
order by a.dc_ch, a.yf
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
@ -255,7 +255,7 @@
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="jhzl" resultType="BigDecimal">
|
|
|
|
<select id="jhzl" resultType="BigDecimal">
|
|
|
|
SELECT SUM(isnull(bclqzl,0)/1000) FROM dm_ydjh WHERE jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
SELECT SUM(isnull(bclqzl,0)/1000) FROM dm_ydjh WHERE jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="wczl" resultType="BigDecimal">
|
|
|
|
<select id="wczl" resultType="BigDecimal">
|
|
|
@ -264,6 +264,6 @@
|
|
|
|
FROM
|
|
|
|
FROM
|
|
|
|
dm_ydjh
|
|
|
|
dm_ydjh
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b'
|
|
|
|
jssj BETWEEN #{from} and #{to} and lx='b' and ylbs='N'
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|
|
|
|