|
|
|
@ -387,7 +387,71 @@
|
|
|
|
|
ORDER BY dm_ydjh.dc_ch,
|
|
|
|
|
dm_ydjh.dc_pl
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getDhjh1" resultType="com.dsic.gj_erp.bean.pgd.PgdDh">
|
|
|
|
|
SELECT
|
|
|
|
|
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,
|
|
|
|
|
'01' as zt,
|
|
|
|
|
(CASE dm_ydjh.wpgg
|
|
|
|
|
WHEN null THEN null
|
|
|
|
|
WHEN '' THEN null
|
|
|
|
|
ELSE CAST( left(dm_ydjh.wpgg,charindex('*',dm_ydjh.wpgg,1)-1)as char)
|
|
|
|
|
END)as hd,
|
|
|
|
|
(CASE dm_ydjh.wpgg
|
|
|
|
|
WHEN null THEN null
|
|
|
|
|
WHEN '' THEN null
|
|
|
|
|
ELSE CAST( SUBSTRING(dm_ydjh.wpgg, charindex('*',dm_ydjh.wpgg,charindex('*',dm_ydjh.wpgg,1)+1)+1,LEN(dm_ydjh.wpgg))as char)
|
|
|
|
|
END) as cd,
|
|
|
|
|
(CASE dm_ydjh.wpgg
|
|
|
|
|
WHEN null THEN null
|
|
|
|
|
WHEN '' THEN null
|
|
|
|
|
ELSE CAST( left(SUBSTRING(dm_ydjh.wpgg,charindex('*',dm_ydjh.wpgg,1)+1, LEN(dm_ydjh.wpgg)),
|
|
|
|
|
charindex('*',SUBSTRING(dm_ydjh.wpgg,charindex('*',dm_ydjh.wpgg,1)+1, LEN(dm_ydjh.wpgg)),1)-1)as char)
|
|
|
|
|
END) as kd,
|
|
|
|
|
dhxx.DHSL as xqsl
|
|
|
|
|
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,
|
|
|
|
|
'00' as zt
|
|
|
|
|
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
|
|
|
|
|
and dm_ydjh.id in
|
|
|
|
|
<foreach collection="ids" index="index" item="item" open="(" separator="," close=");">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
ORDER BY dm_ydjh.dc_ch,
|
|
|
|
|
dm_ydjh.dc_pl
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getSljh" resultType="com.dsic.gj_erp.bean.pgd.PgdSljh">
|
|
|
|
|
insert into pgd_sljh
|
|
|
|
|
(
|
|
|
|
|