You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

475 lines
19 KiB

<?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.dsic.gj_erp.mapper.jhgk.DmSygdMxMapper">
<!-- 通用查询映射结果 -->
<select id="getDhsl" resultType="Dhdto" parameterType="Dhdto">
select ISNULL(im_crklsz.HDSL, 0) as hdsl,
MS_DDMXP.WPHD as wphd,
MS_DDMXP.WPCD as wpcd,
MS_DDMXP.WPKD as wpkd,
MS_DDMXP.RKXH as rkxh,
#{dcCh} as dcCh,
#{dcPl} as dcPl,
#{dhqd} as dhqd,
#{gcxqq} as gcxqq
from MS_DDJBP,MS_DDMXP LEFT JOIN im_crklsz on im_crklsz.GCDDH=MS_DDMXP.dc_ch
where
RTRIM(MS_DDJBP.CGFLM) = MS_DDMXP.cgflm
and RTRIM(MS_DDJBP.DDH) = MS_DDMXP.DDH
and (MS_DDJBP.DDLX) = 'B'
and MS_DDJBP.dhqdh=#{dhqdh}
and MS_DDMXP.WPHD=#{wphd}
and MS_DDMXP.WPCD=#{wpcd}
and MS_DDMXP.WPKD=#{rkxh}
GROUP BY MS_DDMXP.WPHD,MS_DDMXP.WPCD,MS_DDMXP.WPKD,MS_DDMXP.RKXH
</select>
1 year ago
<select id="getLjxx" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMxLj">
1 year ago
insert into dm_sygd_mx_lj(
xzglxq ,
dzglxq ,
dcch,
pl,
fd,
mbch,
xqdd,
pw,
lqlb,
kw,
sbbh,
sclx,
zl,
wpcz,
wpgg,
bh,
bc,
yqyl,
qgcd,
tzbh,
tlsl,
pklx,
qbs,
pkbs,
pkcd,
dmbs,
dmcd,
zpsx,
ljbh,
ljsl,
ljsx,
djmj,
ljdz,
blgs,
pwgs,
llgs,
hxgs,
qggs,
pkgs,
qgs,
dmgs,
zpgs,
fkblgs,
fkpwgs,
fkllgs,
fkhxgs,
fkqggs,
fkpkgs,
fkqgs,
fkdmgs,
fkzpgs,
type,
fds,
hxcd,
lqbs,
xcgs,
xcshms,
bclqzl,
bcshzl,
bcylzl,
bcljtlzl,
ylbhgg,
bcqpyld,
id
)
SELECT
dm_sygdxq.xzglxq ,
dm_sygdxq.dzglxq ,
dm_sygdxq.DC_CH as dcch,
dm_sygdxq.DC_PL as pl,
dm_sygdxq.DC_FD as fd,
dm_bom.mbch,
dm_bom.xqdd,
dm_bom.pw,
dm_bom.lqlb,
dm_bom.kw,
dm_bom.sbbh,
dm_bom.sclx,
dm_bom.zl,
dm_bom.wpcz,
dm_bom.wpgg,
dm_bom.bh,
dm_bom.bc,
dm_bom.yqyl,
dm_bom.qgcd,
(SELECT (CASE WHEN dm_bom.tzbh is null THEN '' ELSE dm_bom.tzbh END)) as tzbh,
dm_bom.tlsl,
dm_bom.pklx,
dm_bom.qbs,
dm_bom.pkbs,
dm_bom.pkcd,
dm_bom.dmbs,
dm_bom.dmcd,
dm_bom.zpsx,
dm_bom.ljbh,
dm_bom.ljsl,
dm_bom.ljsx,
dm_bom.djmj,
dm_bom.ljdz,
dm_bom.blgs,
dm_bom.pwgs,
dm_bom.llgs,
dm_bom.hxgs,
dm_bom.qggs,
dm_bom.pkgs,
dm_bom.qgs,
dm_bom.dmgs,
dm_bom.zpgs,
dm_bom.fkblgs,
dm_bom.fkpwgs,
dm_bom.fkllgs,
dm_bom.fkhxgs,
dm_bom.fkqggs,
dm_bom.fkpkgs,
dm_bom.fkqgs,
dm_bom.fkdmgs,
dm_bom.fkzpgs,
dm_bom.type,
dm_bom.fds,
dm_bom.hxcd,
dm_bom.lqbs,
dm_bom.xcgs,
dm_bom.xcshms,
dm_bom.bclqzl,
dm_bom.bcshzl,
dm_bom.bcylzl,
dm_bom.bcljtlzl,
dm_bom.ylbhgg,
dm_bom.bcqpyld,
REPLACE(CAST(CAST(NEWID()AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER),'-','') as id
from dm_sygdxq LEFT JOIN dm_bom
on dm_bom.dcch = dm_sygdxq.DC_CH
and dm_bom.pl = dm_sygdxq.DC_PL
and dm_bom.fd = dm_sygdxq.DC_FD
where
-- dm_sygdxq.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygdxq.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
ORDER BY dm_sygdxq.xzglxq,dm_sygdxq.DC_CH,dm_sygdxq.DC_PL,dm_bom.TZBH,dm_sygdxq.DC_FD
</select>
<select id="g" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMxLj">
1 year ago
SELECT Em_gcrl.gzr,dm_sygdxq.xzglxq ,dm_sygdxq.dzglxq ,dm_sygdxq.DC_CH as dcch,dm_sygdxq.DC_CH as sjch,dm_sygdxq.DC_PL as pl,dm_sygdxq.DC_FD as fd,dm_bom.*
from Em_gcrl,dm_sygdxq LEFT JOIN dm_bom
on dm_bom.dcch = dm_sygdxq.DC_CH
and dm_bom.pl = dm_sygdxq.DC_PL
and dm_bom.fd = dm_sygdxq.DC_FD
where
dm_sygdxq.xzglxq = Em_gcrl.gl and
1 year ago
-- dm_sygdxq.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygdxq.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
1 year ago
ORDER BY dm_sygdxq.xzglxq,dm_sygdxq.DC_CH,dm_sygdxq.DC_PL,dm_bom.TZBH,dm_sygdxq.DC_FD
</select>
<select id="getMx" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMx">
SELECT
1 year ago
dcch as dc_ch,
mbch as dcCh2,
sjch as dc_ch1,
1 year ago
pl as dc_pl,
tzbh,
stuff((SELECT ' ' + c.FD
FROM dm_sygd_mx_lj c
WHERE c.dcch = dm_sygd_mx_lj.dcch and c.PL = dm_sygd_mx_lj.PL
group by c.FD FOR xml path ( '') ), 1, 1, ''
) AS dc_fd,
MIN(xzglxq) as jssj,
1 year ago
MIN(dzglxq) as gjjs_dz,
1 year ago
(CONVERT(varchar (20), GETDATE(), 20)) as gxsj,
(SELECT (CASE WHEN substring(tzbh, 5, 1) = 'X' THEN 'X' ELSE 'B' END)) as lx,
lqlb,
kw,
zl,
wpcz as wpxh,
wpgg,
ljsl,
pklx,
qbs,
pkbs,
pkcd,
dmbs,
dmcd,
hxcd,
xcgs,
xcshms as xcms,
bclqzl,
bcylzl,
bcljtlzl,
ylbhgg,
bcqpyld
,blgs as blgs
,pwgs as pwgs
,llgs as llgs
,hxgs as hxgs
, qggs as qggs
, sum(pkgs) as pkgs
, sum(dmgs) as dmgs
, sum(qgs) as qjggs
, sum(zpgs) as zpgs
from dm_sygd_mx_lj
where
1 year ago
-- dm_sygd_mx_lj.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygd_mx_lj.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
1 year ago
GROUP BY dcch, mbch, sjch, PL, tzbh
, lqlb, kw, zl, wpcz, wpgg, ljsl, pklx, qbs, pkbs
, pkcd, dmbs, dmcd, hxcd, xcgs, xcshms, bclqzl
, bcylzl, bcljtlzl, ylbhgg, bcqpyld , blgs , pwgs, llgs, hxgs, qggs
order BY jssj, dcch, pl, tzbh
</select>
<select id="getPl" resultType="com.dsic.gj_erp.bean.jhgk.dto.Pldto">
SELECT
1 year ago
(select(case when a.dc_ch is null then b.dc_ch else a.dc_ch end)) as dc_ch,
(select(case when a.DC_FD is null then b.DC_FD else a.DC_FD end)) as DC_FD,
(select(case when a.dc_pl is null then b.dc_pl else a.dc_pl end)) as dc_pl,
1 year ago
DATEDIFF(day, b.dzjsq , a.dzglxq) as dzcz,
DATEDIFF(day, b.xzjsq , a.xzglxq) as xzcz,
a.dzglxq,a.xzglxq,b.xzjsq,b.dzjsq
from
(SELECT dm_sygdxq.dc_ch,dm_sygdxq.DC_FD,dm_sygdxq.dc_pl,dm_sygdxq.dzglxq,dm_sygdxq.xzglxq
from dm_sygdxq WHERE
dm_sygdxq.xzglxq BETWEEN #{begin} and #{end})a
FULL JOIN
(SELECT dm_czplp_new.DC_CH,dm_czplp_new.DC_fd,dm_czplp_new.DC_PL,dm_czplp_new.xzjsq,dm_czplp_new.dzjsq from dm_czplp_new WHERE
dm_czplp_new.xzjsq BETWEEN #{begin} and #{end})b
on
a.DC_CH=b.DC_CH and a.dc_pl=b.DC_PL and a.DC_fd=b.DC_fd
ORDER BY case when a.xzglxq is null then 1 else 0 end,a.xzglxq,dc_ch,dc_pl,b.xzjsq asc
</select>
<update id="setParent" >
UPDATE dm_sygd_mx_lj set dm_sygd_mx_lj.parent_id=dm_sygd_mx.id
from dm_sygd_mx
WHERE
1 year ago
dm_sygd_mx_lj.dcch=dm_sygd_mx.dc_ch
and dm_sygd_mx_lj.pl=dm_sygd_mx.dc_pl
and (dm_sygd_mx_lj.tzbh = '' or dm_sygd_mx_lj.tzbh=dm_sygd_mx.tzbh )
-- and dm_sygd_mx_lj.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygd_mx_lj.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
1 year ago
</update>
<select id="getkw" resultType="com.dsic.gj_erp.bean.jhgk.dto.Kwdto">
SELECT
dm_sygd_mx.*
, (select sum(MS_DDMXP.DHSL) as DHSL
from MS_DDJBP,
MS_DDMXP
where RTRIM(MS_DDJBP.CGFLM) = MS_DDMXP.cgflm
and RTRIM(MS_DDJBP.DDH) = MS_DDMXP.DDH
and (MS_DDJBP.DDLX) = 'B'
and MS_DDJBP.dhqdh = dm_czplp_new.dhqd
GROUP BY MS_DDJBP.CGFLM, MS_DDJBP.DDH, MS_DDJBP.ddmc
) as dhsl
, (select sum(im_crklsz.HDSL) as lhsl
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 MS_DDJBP.dhqdh = dm_czplp_new.dhqd
and im_crklsz.CRKBS = 'RK'
and im_crklsz.HDLX <![CDATA[ <> ]]> '99'
GROUP BY MS_DDJBP.CGFLM, MS_DDJBP.DDH, MS_DDJBP.ddmc
) as lhsl
, dm_czplp_new.dhqd as dhqd
from (
SELECT
substring(dm_sygd_mx.jssj, 0, 8) as yf
, kw
, dm_sygd_mx.dc_ch as ch
, dm_sygd_mx.dc_pl as pl
, dm_sygd_mx.dc_fd as fd
, COUNT(1) as bs
, sum(blgs) as blgs
, sum(pwgs) as pwgs
, sum(llgs) as llgs
, sum(hxgs) as hxgs
, sum(qggs) as qggs
, sum(pkgs) as pkgs
, sum(dmgs) as dmgs
, sum(qgs) as qjggs
, sum(zpgs) as zpgs
from dm_sygd_mx
where dm_sygd_mx.jssj BETWEEN #{begin} and #{end}
GROUP BY substring(dm_sygd_mx.jssj, 0, 8), dm_sygd_mx.kw
, dm_sygd_mx.dc_ch
, dm_sygd_mx.dc_pl
, dm_sygd_mx.dc_fd
) dm_sygd_mx
LEFT JOIN (SELECT dm_czplp_new.dhqd, dm_czplp_new.DC_PL, dm_czplp_new.DC_CH
from dm_czplp_new
GROUP BY dm_czplp_new.DC_PL, dm_czplp_new.DC_CH, dhqd
) dm_czplp_new
on dm_czplp_new.DC_PL = dm_sygd_mx.pl
and dm_czplp_new.DC_CH = dm_sygd_mx.ch
order by dm_sygd_mx.yf
, case when dm_sygd_mx.kw is null then 1 else 0 end
,dm_sygd_mx.kw
1 year ago
,dm_sygd_mx.ch
1 year ago
,dm_sygd_mx.PL
</select>
<!-- 采购计划到货情况 -->
<select id="cgjhdhqk" resultType="map">
SELECT (MS_DDMXP.CGFLM) AS CGFLM,
(MS_DDMXP.DDH) AS DDH,
MS_DDMXP.DDXH ,
(MS_DDMXP.WPH) AS WPH,
(MS_DDMXP.JLDW) AS JLDW,
MS_DDMXP.DHSL ,
MS_DDMXP.DDDJ ,
MS_DDMXP.SJDJ ,
(MS_DDMXP.JHRQ) AS JHRQ,
MS_DDMXP.CGAQ,
(MS_DDMXP.DHRQ) AS DHRQ,
(MS_DDMXP.DGH) AS DGH,
(MS_DDMXP.BZDW) AS BZDW,
MS_DDMXP.BZL ,
MS_DDMXP.SDSL ,
(MS_DDMXP.FKBS) AS FKBS,
(MS_DDMXP.XGR) AS XGR,
(MS_DDMXP.XGRQ) AS XGRQ,
(MS_DDMXP.MFBS) AS MFBS,
(MS_DDMXP.DYWPH) AS DYWPH,
(MS_DDMXP.JHLSH) AS JHLSH,
MS_DDMXP.JHXH,
MS_DDMXP.RWDH AS RWDH,
(MS_DDMXP.FPZT) AS FPZT,
(MS_DDMXP.DHZT) AS DHZT,
(MS_DDMXP.DC_CH) AS DC_CH,
(MS_DDMXP.DC_CM) AS DC_CM,
(MS_DDMXP.DC_PL) AS DC_PL,
(MS_DDMXP.DC_FD) AS DC_FD,
(MS_DDMXP.CLZT) AS CLZT,
(MS_DDMXP.JLDW1) AS JLDW1,
MS_DDMXP.DHSL1,
MS_DDMXP.WPHD,
MS_DDMXP.WPKD,
MS_DDMXP.WPCD,
dm_wpjbp.wpgg AS RKGG,
dm_wpjbp.wpxh AS RKXH,
(MS_DDMXP.YLZD1) AS YLZD1,
MS_DDMXP.ylzd4,
MS_DDMXP.ylzd5,
MS_DDMXP.ylzd6,
MS_DDMXP.DHJE ,
MS_DDMXP.CD,
MS_DDMXP.DZ,
dm_wpjbp.wpmc as wpmc,
DDYFDJ,
0.00 as ddyfje_hj,
DHSLN ,
DHSL1N ,
DHJEN ,
im_rkrk.hdsl as lszrk,
im_rkrk.hdsl*convert(decimal(10,1) , convert(decimal(10,1),left(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)-1)) * convert(integer,substring(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1 ,charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) - charindex('*',DM_WPJBP.WPGG,1)- 1 )) / 1000 * convert(integer,right(DM_WPJBP.WPGG,len(DM_WPJBP.WPGG )- charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) )) * 7.85 /1000000) as lszrkzl,
MS_DDMXP.DHSL - isnull(im_rkrk.hdsl,0) as lszrk_tj,
MS_DDMXP.DHSL1 - isnull(im_rkrk.hdsl*convert(decimal(10,1) , convert(decimal(10,1),left(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)-1)) * convert(integer,substring(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1 ,charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) - charindex('*',DM_WPJBP.WPGG,1)- 1 )) / 1000 * convert(integer,right(DM_WPJBP.WPGG,len(DM_WPJBP.WPGG )- charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) )) * 7.85 /1000000),0) as lszrkzl_tj,
im_ckck.hdsl as lszck,
im_ckck.hdsl*convert(decimal(10,1) , convert(decimal(10,1),left(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)-1)) * convert(integer,substring(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1 ,charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) - charindex('*',DM_WPJBP.WPGG,1)- 1 )) / 1000 * convert(integer,right(DM_WPJBP.WPGG,len(DM_WPJBP.WPGG )- charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) )) * 7.85 /1000000) as lszckzl,
MS_DDMXP.DHSL - isnull(im_ckck.hdsl,0) as lszck_tj,
MS_DDMXP.DHSL1 - isnull(im_ckck.hdsl*convert(decimal(10,1) , convert(decimal(10,1),left(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)-1)) * convert(integer,substring(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1 ,charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) - charindex('*',DM_WPJBP.WPGG,1)- 1 )) / 1000 * convert(integer,right(DM_WPJBP.WPGG,len(DM_WPJBP.WPGG )- charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) )) * 7.85 /1000000),0) as lszckzl_tj,
im_kckc.hdsl as kcsl,
isnull(im_kckc.hdsl*convert(decimal(10,1) , convert(decimal(10,1),left(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)-1)) * convert(integer,substring(DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1 ,charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) - charindex('*',DM_WPJBP.WPGG,1)- 1 )) / 1000 * convert(integer,right(DM_WPJBP.WPGG,len(DM_WPJBP.WPGG )- charindex('*',DM_WPJBP.WPGG,charindex('*',DM_WPJBP.WPGG,1)+1) )) * 7.85 /1000000),0) as kczl,
MS_DDJBP.wjwz,
MS_DDJBP.dzwz,
MS_DDJBP.ddmc,
MS_DDJBP.ghsbm,
MS_DDJBP.ddh,
MS_DDJBP.sxrq,
MS_DDJBP.lrr as cgy,
0 as xh_gs,
0.000 as xh_zl,
0.00 as xh_je,
0 as yg_gs,
0.000 as gy_zl,
0.00 as yg_je,
0.00 as yg_jece,
'' as fph,
'' as fpbs,
'' as rkbs,
'' as ckbs,
'' as rkzt,
'' as ckzt
FROM MS_DDMXP
left join dm_wpjbp on(MS_DDMXP.wph = dm_wpjbp.wph)
join MS_DDJBP on((MS_DDJBP.CGFLM) = (MS_DDMXP.CGFLM) AND (MS_DDJBP.ddh) = (MS_DDMXP.ddh) AND (MS_DDJBP.CGFLM) = '01' AND (MS_DDJBP.DDLX) = 'B')
left join(select im_crklsz.DC_FD,im_crklsz.GCDDH,
sum(im_crklsz.HDSL) as hdsl,
round(sum(im_crklsz.KCSL*im_crklsz.jg/1000),3) as hdsl1
from im_crklsz
where im_crklsz.CKH = '01' and im_crklsz.HDLX &lt;&gt; '99' and im_crklsz.CRKBS = 'RK'
group by im_crklsz.DC_FD,im_crklsz.GCDDH) as im_rkrk on(MS_DDJBP.ddmc = im_rkrk.DC_FD and MS_DDMXP.dc_ch = im_rkrk.GCDDH)
left join(select im_crklsz.DC_FD,im_crklsz.GCDDH,
sum(im_crklsz.HDSL) as hdsl,
round(sum(im_crklsz.KCSL*im_crklsz.jg/1000),3) as hdsl1
from im_crklsz
where im_crklsz.CKH = '01' and im_crklsz.HDLX &lt;&gt; '99' and im_crklsz.CRKBS = 'CK'
group by im_crklsz.DC_FD,im_crklsz.GCDDH) as im_ckck on(MS_DDJBP.ddmc = im_ckck.DC_FD and MS_DDMXP.dc_ch = im_ckck.GCDDH)
left join(select IM_CKWPKWP.DC_FD,IM_CKWPKWP.GCDDH,
sum(IM_CKWPKWP.qxkcl) as hdsl,
0 as hdsl1
from IM_CKWPKWP
where IM_CKWPKWP.CKH = '01'
group by IM_CKWPKWP.DC_FD,IM_CKWPKWP.GCDDH) as im_kckc on(MS_DDJBP.ddmc = im_kckc.DC_FD and MS_DDMXP.dc_ch = im_kckc.GCDDH)
WHERE (MS_DDMXP.CGFLM) = '01'
<if test="ghsbm != null and ghsbm!=''">
and MS_DDMXP.ghsbm=#{ghsbm}
</if>
<if test="wjwz != null and wjwz!=''">
and MS_DDJBP.wjwz=#{wjwz}
</if>
<if test="ddmc != null and ddmc!=''">
and MS_DDJBP.ddmc=#{ddmc}
</if>
<if test="xhth != null and xhth!=''">
and MS_DDMXP.dc_ch=#{xhth}
</if>
<if test="ksrq != null and ksrq!=''">
and MS_DDJBP.sxrq&gt;=#{ksrq}
</if>
<if test="jsrq != null and jsrq!=''">
and MS_DDJBP.sxrq&lt;=#{jsrq}
</if>
</select>
</mapper>