|
|
|
@ -203,69 +203,54 @@
|
|
|
|
|
dm_czplp_new.xfq_tlt,
|
|
|
|
|
dm_czplp_new.jsq_tlt
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getDhjh" resultType="com.dsic.gj_erp.bean.pgd.PgdDh">
|
|
|
|
|
insert into pgd_dh
|
|
|
|
|
(id,
|
|
|
|
|
czbh,
|
|
|
|
|
pl,
|
|
|
|
|
dhqdh,
|
|
|
|
|
wpcz,
|
|
|
|
|
slxqrq,
|
|
|
|
|
qfxqrqxz,
|
|
|
|
|
qfxqrqdz,
|
|
|
|
|
hth,
|
|
|
|
|
xhth,
|
|
|
|
|
dhsl,
|
|
|
|
|
hd,
|
|
|
|
|
kd,
|
|
|
|
|
cd,
|
|
|
|
|
xqsl)
|
|
|
|
|
SELECT
|
|
|
|
|
REPLACE(CAST(CAST(NEWID()AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER),'-','') as id,
|
|
|
|
|
dm_ydjh.dc_ch as czbh,
|
|
|
|
|
dm_ydjh.dhqd as dhqdh,
|
|
|
|
|
dm_ydjh.jssj as qfxqrqxz,
|
|
|
|
|
dm_ydjh.gjjs_dz as qfxqrqdz,
|
|
|
|
|
dm_ydjh.slrq as slxqrq,
|
|
|
|
|
dhxx.ddmc as hth,
|
|
|
|
|
dhxx.dc_ch as xhth,
|
|
|
|
|
dhxx.DHSL as xqsl,
|
|
|
|
|
dhxx.HDSL as dhsl,
|
|
|
|
|
dhxx.WPHD as hd,
|
|
|
|
|
dhxx.WPCD as cd,
|
|
|
|
|
dhxx.WPKD as kd,
|
|
|
|
|
dhxx.RKXH as wpcz
|
|
|
|
|
from dm_ydjh
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
(select MS_DDJBP.CGFLM,
|
|
|
|
|
MS_DDJBP.DDH,
|
|
|
|
|
MS_DDJBP.ddmc as ddmc,
|
|
|
|
|
MS_DDMXP.dc_ch as dc_ch,
|
|
|
|
|
sum(MS_DDMXP.DHSL) as DHSL,
|
|
|
|
|
sum(im_crklsz.HDSL) as HDSL,
|
|
|
|
|
MS_DDMXP.WPHD as WPHD,
|
|
|
|
|
MS_DDMXP.WPCD as WPCD,
|
|
|
|
|
MS_DDMXP.WPKD as WPKD,
|
|
|
|
|
MS_DDMXP.RKXH as RKXH,
|
|
|
|
|
MS_DDJBP.dhqdh as dhqdh
|
|
|
|
|
from MS_DDJBP,
|
|
|
|
|
MS_DDMXP,
|
|
|
|
|
im_crklsz
|
|
|
|
|
where MS_DDJBP.ddmc = im_crklsz.dc_fd
|
|
|
|
|
and MS_DDMXP.dc_ch = im_crklsz.GCDDH
|
|
|
|
|
and RTRIM(MS_DDJBP.CGFLM) = MS_DDMXP.cgflm
|
|
|
|
|
and RTRIM(MS_DDJBP.DDH) = MS_DDMXP.DDH
|
|
|
|
|
and (MS_DDJBP.DDLX) = 'B'
|
|
|
|
|
and im_crklsz.CKH = '01'
|
|
|
|
|
and im_crklsz.CRKBS = 'RK'
|
|
|
|
|
and im_crklsz.HDLX <![CDATA[ <> ]]> '99'
|
|
|
|
|
GROUP BY MS_DDJBP.CGFLM, MS_DDJBP.DDH, MS_DDJBP.ddmc, MS_DDMXP.dc_ch, MS_DDMXP.WPHD, MS_DDMXP.WPCD,
|
|
|
|
|
MS_DDMXP.WPKD, MS_DDMXP.RKXH, MS_DDJBP.dhqdh) dhxx
|
|
|
|
|
on dhxx.dhqdh = dm_ydjh.dhqd
|
|
|
|
|
where dm_ydjh.slrq BETWEEN #{begin} and #{end}
|
|
|
|
|
dm_ydjh.dc_ch as czbh,
|
|
|
|
|
dm_ydjh.dc_pl as pl,
|
|
|
|
|
dm_ydjh.dhqd as dhqdh,
|
|
|
|
|
dhxx.RKXH as wpcz,
|
|
|
|
|
dm_ydjh.slrq as slxqrq,
|
|
|
|
|
dm_ydjh.jssj as qfxqrqxz,
|
|
|
|
|
dm_ydjh.gjjs_dz as qfxqrqdz,
|
|
|
|
|
dhxx.ddmc as hth,
|
|
|
|
|
dhxx.dc_ch as xhth,
|
|
|
|
|
dhxx.HDSL as dhsl,
|
|
|
|
|
dhxx.WPHD as hd,
|
|
|
|
|
dhxx.WPCD as cd,
|
|
|
|
|
dhxx.WPKD as kd,
|
|
|
|
|
dhxx.DHSL as xqsl
|
|
|
|
|
from dm_ydjh ,
|
|
|
|
|
(select MS_DDJBP.CGFLM,
|
|
|
|
|
MS_DDJBP.DDH,
|
|
|
|
|
MS_DDJBP.ddmc as ddmc,
|
|
|
|
|
MS_DDMXP.dc_ch as dc_ch,
|
|
|
|
|
sum(MS_DDMXP.DHSL) as DHSL,
|
|
|
|
|
sum(im_crklsz.HDSL) as HDSL,
|
|
|
|
|
MS_DDMXP.WPHD as WPHD,
|
|
|
|
|
MS_DDMXP.WPCD as WPCD,
|
|
|
|
|
MS_DDMXP.WPKD as WPKD,
|
|
|
|
|
MS_DDMXP.RKXH as RKXH,
|
|
|
|
|
MS_DDJBP.dhqdh as dhqdh
|
|
|
|
|
from MS_DDJBP,
|
|
|
|
|
MS_DDMXP,
|
|
|
|
|
im_crklsz
|
|
|
|
|
where MS_DDJBP.ddmc = im_crklsz.dc_fd
|
|
|
|
|
and MS_DDMXP.dc_ch = im_crklsz.GCDDH
|
|
|
|
|
and RTRIM(MS_DDJBP.CGFLM) = MS_DDMXP.cgflm
|
|
|
|
|
and RTRIM(MS_DDJBP.DDH) = MS_DDMXP.DDH
|
|
|
|
|
and (MS_DDJBP.DDLX) = 'B'
|
|
|
|
|
and im_crklsz.CKH = '01'
|
|
|
|
|
and im_crklsz.CRKBS = 'RK'
|
|
|
|
|
and im_crklsz.HDLX <![CDATA[ <> ]]> '99'
|
|
|
|
|
GROUP BY MS_DDJBP.CGFLM, MS_DDJBP.DDH, MS_DDJBP.ddmc, MS_DDMXP.dc_ch, MS_DDMXP.WPHD, MS_DDMXP.WPCD,
|
|
|
|
|
MS_DDMXP.WPKD, MS_DDMXP.RKXH, MS_DDJBP.dhqdh) dhxx
|
|
|
|
|
where dhxx.dhqdh = dm_ydjh.dhqd and dhxx.dhqdh is not null and
|
|
|
|
|
dm_ydjh.slrq BETWEEN #{begin} and #{end}
|
|
|
|
|
ORDER BY dm_ydjh.dc_ch,
|
|
|
|
|
dm_ydjh.dc_pl
|
|
|
|
|
dm_ydjh.dc_pl
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSljh" resultType="com.dsic.gj_erp.bean.pgd.PgdSljh">
|
|
|
|
|
insert into pgd_sljh
|
|
|
|
|
(
|
|
|
|
|