|
@@ -36,12 +36,24 @@
|
|
|
<association property="technicianEntity" column="XMFZR" select="org.sky.scientific.mapper.TechnicianMapper.selectById"/>
|
|
<association property="technicianEntity" column="XMFZR" select="org.sky.scientific.mapper.TechnicianMapper.selectById"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
+ <update id="updateXm" parameterType="org.sky.scientific.pojo.dto.XmUpdateDto">
|
|
|
|
|
+ update kd_xm
|
|
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
|
|
+ <if test="yjlx != null and yjlx!=''">yjlx = #{yjlx},</if>
|
|
|
|
|
+ <if test="xmly != null and xmly!=''">xmly = #{xmly},</if>
|
|
|
|
|
+ <if test="xmkzxs != null and xmkzxs!=''">xmkzxs = #{xmkzxs},</if>
|
|
|
|
|
+ <if test="yqcgxs != null and yqcgxs!=''">yqcgxs = #{yqcgxs},</if>
|
|
|
|
|
+ <if test="yqcgxs != null and yqcgxs!=''">yqcgxs = #{yqcgxs},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{xmId}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
<select id="selectXmPage" resultMap="ResultMap">
|
|
<select id="selectXmPage" resultMap="ResultMap">
|
|
|
SELECT
|
|
SELECT
|
|
|
xm.id,
|
|
xm.id,
|
|
|
xm.XMBH,
|
|
xm.XMBH,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMKSSJ) AS XMKSSJ,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
WHERE DATE_FORMAT(XMKSSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth}
|
|
WHERE DATE_FORMAT(XMKSSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth}
|
|
@@ -52,7 +64,7 @@
|
|
|
xm.id,
|
|
xm.id,
|
|
|
xm.XMBH,
|
|
xm.XMBH,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{year} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{year} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{year} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMKSSJ) AS XMKSSJ,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{year} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{year} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
WHERE #{year} between DATE_FORMAT(XMKSSJ, '%Y') and DATE_FORMAT(XMJSSJ, '%Y')
|
|
WHERE #{year} between DATE_FORMAT(XMKSSJ, '%Y') and DATE_FORMAT(XMJSSJ, '%Y')
|
|
@@ -63,16 +75,25 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="summaryPage" resultType="org.sky.scientific.pojo.vo.XmSummary">
|
|
<select id="summaryPage" resultType="org.sky.scientific.pojo.vo.XmSummary">
|
|
|
- SELECT xm.id, xm.XMBH,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'xmmc' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1), xm.XMMC ) AS XMMC,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMFZR' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMFZR) AS XMFZR,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDWID' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDWID) AS XMSQDWID,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDW) AS XMSQDW,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMKSSJ) AS XMKSSJ,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMJSSJ) AS XMJSSJ,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMYSZE' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMYSZE) AS XMYSZE,
|
|
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'status' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.status) AS status,
|
|
|
|
|
- LXBG
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ xm.id, xm.XMBH,
|
|
|
|
|
+ COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'xmmc' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1), xm.XMMC ) AS XMMC,
|
|
|
|
|
+ COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMFZR' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMFZR) AS XMFZR,
|
|
|
|
|
+ COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDWID' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDWID) AS XMSQDWID,
|
|
|
|
|
+ (SELECT CONCAT_WS('/',(SELECT name FROM kd_department d2 WHERE d2.id = d1.parent_id), d1.`name`) as departmentName FROM kd_department d1 WHERE d1.id = XMSQDWID) AS XMSQDW,
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
|
|
+ COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMJSSJ) AS XMJSSJ,
|
|
|
|
|
+ COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMYSZEMX' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMYSZEMX) AS XMYSZEMX,
|
|
|
|
|
+ COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'status' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.status) AS status,
|
|
|
|
|
+ LXBG as lxbg,
|
|
|
|
|
+ (select count(*) from kd_xm_jdxbg jdxbg where jdxbg.xm_id = xm.id and date_format(jdxbg.fill_date,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as jdxbgCount,
|
|
|
|
|
+ (select count(*) from kd_xm_jtb jtb where jtb.xm_id = xm.id and ysbg!=null and date_format(jtb.tbsj,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as ysbgCount,
|
|
|
|
|
+ (select count(*) from kd_cg_zl zl where zl.xm_id = xm.id and zl.ZLLX = '发明专利' and date_format(zl.SHOUQUAN_RQ,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as fmzlCount,
|
|
|
|
|
+ (select count(*) from kd_cg_zl zl where zl.xm_id = xm.id and zl.ZLLX = '实用新型专利' and date_format(zl.SHOUQUAN_RQ,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as syxxzlCount,
|
|
|
|
|
+ (select count(*) from kd_cg_rjzzq rjzzq where rjzzq.xm_id = xm.id and date_format(rjzzq.DJPZRQ,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as rzCount,
|
|
|
|
|
+ (select count(*) from kd_cg_jsbz jsbz where jsbz.xm_id = xm.id and date_format(jsbz.SSRQ,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as bzCount,
|
|
|
|
|
+ (select count(*) from kd_cg_kylw kylw where kylw.xm_id = xm.id and date_format(kylw.FBRQ,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as lwCount,
|
|
|
|
|
+ (select count(*) from kd_cg_qt qt where qt.xm_id = xm.id and date_format(qt.SHOUQUAN_RQ,'%Y%m') between concat(left(#{ew.yearAndMonth},4),'01') and #{ew.yearAndMonth}) as qtCount
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
WHERE xm.is_deleted = 0
|
|
WHERE xm.is_deleted = 0
|
|
|
and DATE_FORMAT(xm.XMKSSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth}
|
|
and DATE_FORMAT(xm.XMKSSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth}
|
|
@@ -87,7 +108,7 @@
|
|
|
SELECT xm.id as xmId,
|
|
SELECT xm.id as xmId,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'xmmc' ORDER BY bgrz.BGSXSJ DESC LIMIT 1), xm.XMMC ) AS xmmc,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'xmmc' ORDER BY bgrz.BGSXSJ DESC LIMIT 1), xm.XMMC ) AS xmmc,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDW) AS xmsqdw,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDW) AS xmsqdw,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMKSSJ) AS xmkssj,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMJSSJ) AS xmjssj,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMJSSJ) AS xmjssj,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMYSZE' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMYSZE) AS xmysze,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMYSZE' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMYSZE) AS xmysze,
|
|
|
(select sum(ZZSC*PJRGFY) from kd_ys_ryrgfy where XM_ID = #{xmId}) as ryrgfy,
|
|
(select sum(ZZSC*PJRGFY) from kd_ys_ryrgfy where XM_ID = #{xmId}) as ryrgfy,
|
|
@@ -107,7 +128,7 @@
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'xmmc' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1), XMMC ) AS XMMC,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'xmmc' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1), XMMC ) AS XMMC,
|
|
|
XMBH,
|
|
XMBH,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMSQDW) AS XMSQDW,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMSQDW) AS XMSQDW,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMKSSJ) AS XMKSSJ,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = id AND bgrz.ZDMC = 'XMFZR' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMFZR) AS XMFZR,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = id AND bgrz.ZDMC = 'XMFZR' AND DATE_FORMAT(bgrz.BGSXSJ, '%Y%m') <![CDATA[<=]]> #{param2} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMFZR) AS XMFZR,
|
|
|
XMLY,
|
|
XMLY,
|
|
@@ -127,7 +148,7 @@
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = id AND bgrz.ZDMC = 'XMFZR' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMFZR) AS XMFZR,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = id AND bgrz.ZDMC = 'XMFZR' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMFZR) AS XMFZR,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMSQDW) AS XMSQDW,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDW' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMSQDW) AS XMSQDW,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDWID' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDWID) AS XMSQDWID,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMSQDWID' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),xm.XMSQDWID) AS XMSQDWID,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMKSSJ) AS XMKSSJ,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ,
|
|
|
YJLX,
|
|
YJLX,
|
|
|
XMLY,
|
|
XMLY,
|
|
@@ -155,7 +176,7 @@
|
|
|
id,
|
|
id,
|
|
|
XMBH,
|
|
XMBH,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMKSSJ) AS XMKSSJ,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
where #{yearAndMonth} between DATE_FORMAT(XMKSSJ, '%Y%m') and DATE_FORMAT(XMJSSJ,'%Y%m')
|
|
where #{yearAndMonth} between DATE_FORMAT(XMKSSJ, '%Y%m') and DATE_FORMAT(XMJSSJ,'%Y%m')
|
|
@@ -166,7 +187,7 @@
|
|
|
xm.id,
|
|
xm.id,
|
|
|
xm.XMBH,
|
|
xm.XMBH,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMMC' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMMC) AS XMMC,
|
|
|
- COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMKSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMKSSJ) AS XMKSSJ,
|
|
|
|
|
|
|
+ xm.XMKSSJ,
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMJSSJ' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMJSSJ) AS XMJSSJ
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
WHERE #{ew.yearAndMonth} between DATE_FORMAT(XMKSSJ, '%Y') and DATE_FORMAT(XMJSSJ,'%Y')
|
|
WHERE #{ew.yearAndMonth} between DATE_FORMAT(XMKSSJ, '%Y') and DATE_FORMAT(XMJSSJ,'%Y')
|