|
@@ -63,8 +63,10 @@
|
|
|
xm.XMKSSJ,
|
|
xm.XMKSSJ,
|
|
|
COALESCE(get_xm_info(xm.id,'XMJSSJ', #{ew.yearAndMonth}),XMJSSJ) AS XMJSSJ
|
|
COALESCE(get_xm_info(xm.id,'XMJSSJ', #{ew.yearAndMonth}),XMJSSJ) AS XMJSSJ
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
- WHERE DATE_FORMAT(XMKSSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth}
|
|
|
|
|
- and xm.status != 0
|
|
|
|
|
|
|
+ WHERE xm.status != 0
|
|
|
|
|
+ <if test = "ew.use==0">
|
|
|
|
|
+ and #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
|
|
|
|
|
+ </if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectXmListByYear" resultMap="ResultMap">
|
|
<select id="selectXmListByYear" resultMap="ResultMap">
|
|
@@ -76,7 +78,8 @@
|
|
|
COALESCE(get_xm_info(xm.id,'XMJSSJ', #{year}),XMJSSJ) AS XMJSSJ,
|
|
COALESCE(get_xm_info(xm.id,'XMJSSJ', #{year}),XMJSSJ) AS XMJSSJ,
|
|
|
COALESCE(get_xm_info(xm.id,'STATUS', #{year}),STATUS) AS status
|
|
COALESCE(get_xm_info(xm.id,'STATUS', #{year}),STATUS) AS status
|
|
|
FROM kd_xm xm
|
|
FROM kd_xm xm
|
|
|
- WHERE #{year} between DATE_FORMAT(XMKSSJ, '%Y') and DATE_FORMAT(COALESCE(get_xm_info(xm.id,'XMJSSJ', #{year}),XMJSSJ), '%Y')
|
|
|
|
|
|
|
+ WHERE xm.status != 0
|
|
|
|
|
+ and #{year} between DATE_FORMAT(XMKSSJ, '%Y') and DATE_FORMAT(COALESCE(get_xm_info(xm.id,'XMJSSJ', #{year}),XMJSSJ), '%Y')
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="summaryPage" resultType="org.sky.scientific.pojo.vo.XmSummary">
|
|
<select id="summaryPage" resultType="org.sky.scientific.pojo.vo.XmSummary">
|
|
@@ -107,7 +110,7 @@
|
|
|
and
|
|
and
|
|
|
(
|
|
(
|
|
|
#{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
|
|
#{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
|
|
|
- or (xm.XMKSSJ is null and xm.status=0 and DATE_FORMAT(xm.create_time, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth})
|
|
|
|
|
|
|
+ or (xm.XMKSSJ is null and xm.status=0)
|
|
|
)
|
|
)
|
|
|
<if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>
|
|
<if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>
|
|
|
<if test="ew.xmmc!=null and ew.xmmc!=''">and COALESCE(get_xm_info(xm.id, 'XMMC', #{ew.yearAndMonth}), xm.XMMC) like concat('%',#{ew.xmmc},'%')</if>
|
|
<if test="ew.xmmc!=null and ew.xmmc!=''">and COALESCE(get_xm_info(xm.id, 'XMMC', #{ew.yearAndMonth}), xm.XMMC) like concat('%',#{ew.xmmc},'%')</if>
|
|
@@ -116,36 +119,6 @@
|
|
|
<if test="ew.status!=null">and COALESCE(get_xm_info(xm.id, 'STATUS', #{ew.yearAndMonth}), xm.STATUS) = #{ew.status}</if>
|
|
<if test="ew.status!=null">and COALESCE(get_xm_info(xm.id, 'STATUS', #{ew.yearAndMonth}), xm.STATUS) = #{ew.status}</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
-<!-- <select id="summaryPage" resultType="org.sky.scientific.pojo.vo.XmSummary">-->
|
|
|
|
|
-<!-- SELECT-->
|
|
|
|
|
-<!-- xm.id, xm.xmbh,xm.xmkssj,-->
|
|
|
|
|
-<!-- COALESCE(get_xm_info(xm.id, 'XMMC', #{ew.yearAndMonth}), xm.XMMC) AS xmmc,-->
|
|
|
|
|
-<!-- COALESCE(get_xm_info(xm.id, 'XMFZR', #{ew.yearAndMonth}), xm.XMFZR) AS xmfzr,-->
|
|
|
|
|
-<!-- tech.name as xmfzrxm,-->
|
|
|
|
|
-<!-- COALESCE(get_xm_info(xm.id, 'XMSQDWID', #{ew.yearAndMonth}), xm.XMSQDWID) AS xmsqdwid,-->
|
|
|
|
|
-<!-- COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}), xm.XMJSSJ) AS xmjssj,-->
|
|
|
|
|
-<!-- COALESCE(get_xm_info(xm.id, 'XMYSZEMX', #{ew.yearAndMonth}), xm.XMYSZEMX) AS xmyszemx,-->
|
|
|
|
|
-<!-- COALESCE(get_xm_info(xm.id, 'STATUS', #{ew.yearAndMonth}), 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 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,-->
|
|
|
|
|
-<!-- (select ifnull(sum(WWFYJE), 0) from kd_xm_wwxm ww where ww.XM_ID = xm.id and ww.year_and_month = left(#{ew.yearAndMonth}, 4)) as wwAmount-->
|
|
|
|
|
-<!-- FROM kd_xm xm-->
|
|
|
|
|
-<!-- LEFT JOIN kd_technician tech ON tech.id = COALESCE(get_xm_info(xm.id, 'XMFZR', #{ew.yearAndMonth}), xm.XMFZR)-->
|
|
|
|
|
-<!-- WHERE xm.tenant_id = #{ew.tenantId} and DATE_FORMAT(xm.XMKSSJ, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth}-->
|
|
|
|
|
-<!-- <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>-->
|
|
|
|
|
-<!-- <if test="ew.xmmc!=null and ew.xmmc!=''">and COALESCE(get_xm_info(xm.id, 'XMMC', #{ew.yearAndMonth}), xm.XMMC) like concat('%',#{ew.xmmc},'%')</if>-->
|
|
|
|
|
-<!-- <if test="ew.xmfzrxm!=null and ew.xmfzrxm!=''">and tech.name like concat('%', #{ew.xmfzrxm},'%')</if>-->
|
|
|
|
|
-<!-- <if test="ew.xmsqdw!=null and ew.xmsqdw!=''">and CONCAT_WS('/',(SELECT name FROM kd_department d2 WHERE d2.id = d.parent_id), d.`name`) like concat('%',#{ew.xmsqdw},'%')</if>-->
|
|
|
|
|
-<!-- <if test="ew.status!=null">and COALESCE(get_xm_info(xm.id, 'STATUS', #{ew.yearAndMonth}), xm.STATUS) = #{ew.status}</if>-->
|
|
|
|
|
-<!-- </select>-->
|
|
|
|
|
-
|
|
|
|
|
<select id="selectYszb" resultType="org.sky.scientific.pojo.vo.XmYszbVO">
|
|
<select id="selectYszb" resultType="org.sky.scientific.pojo.vo.XmYszbVO">
|
|
|
SELECT xm.id as xmId,xm.XMKSSJ,
|
|
SELECT xm.id as xmId,xm.XMKSSJ,
|
|
|
COALESCE(get_xm_info(xm.id, 'XMMC', null), xm.XMMC) AS xmmc,
|
|
COALESCE(get_xm_info(xm.id, 'XMMC', null), xm.XMMC) AS xmmc,
|