|
|
@@ -87,24 +87,52 @@
|
|
|
</select>
|
|
|
|
|
|
<resultMap id="XmFixedAssetCostVo" type="org.sky.scientific.pojo.vo.XmFixedAssetCostVo" extends="ResultMap">
|
|
|
- <result column="attendanceHours" property="attendanceHours"/>
|
|
|
- <result column="workHours" property="workHours"/>
|
|
|
- <result column="yanfaTanXiao" property="yanfaTanXiao"/>
|
|
|
+ <result column="work_hours" property="workHours"/>
|
|
|
+ <result column="yanfa_fen_tan_lv" property="yanfaFenTanLv"/>
|
|
|
+ <result column="yanfa_tan_xiao" property="yanfaTanXiao"/>
|
|
|
</resultMap>
|
|
|
+<!-- <select id="keyanyiqishebeizhejiufeiyongfenpeibiao"-->
|
|
|
+<!-- resultMap="XmFixedAssetCostVo">-->
|
|
|
+<!-- SELECT xa.xm_id, xa.asset_id, xm.XMBH, xm.XMMC,-->
|
|
|
+<!-- asset.ZCBM as 'asset.ZCBM' ,asset.ZCMC as 'asset.ZCMC' ,asset.ZCLB as 'asset.ZCLB',-->
|
|
|
+<!-- asset.YT as 'asset.YT', asset.ZCYZ as 'asset.ZCYZ',asset.JCZ as 'asset.JCZ',asset.YZJE as 'asset.YZJE',ifnull(asset.ZGS,0) as 'asset.ZGS',asset.KSSJ as 'asset.KSSJ',-->
|
|
|
+<!-- ifnull(kxah.work_hours,0) as work_hours-->
|
|
|
+<!-- FROM kd_xm_fixed_asset xa-->
|
|
|
+<!-- LEFT JOIN kd_asset asset ON xa.asset_id = asset.id-->
|
|
|
+<!-- LEFT JOIN-->
|
|
|
+<!-- (-->
|
|
|
+<!-- select xm_id, asset_id, left(work_date, 6) as year_and_month, sum(work_hours) as work_hours-->
|
|
|
+<!-- from kd_xm_asset_hours-->
|
|
|
+<!-- group by xm_id, asset_id, left(work_date, 6)-->
|
|
|
+<!-- )as kxah on kxah.xm_id = xa.xm_id and kxah.asset_id = xa.asset_id and kxah.year_and_month= #{ew.yearAndMonth}-->
|
|
|
+<!-- LEFT JOIN-->
|
|
|
+<!-- (-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- xm.id,-->
|
|
|
+<!-- 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 = 'XMBH' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMBH) AS XMBH-->
|
|
|
+<!-- FROM kd_xm xm-->
|
|
|
+<!-- WHERE xm.is_deleted = 0-->
|
|
|
+<!-- ) xm on xm.id = xa.xm_id-->
|
|
|
+<!-- WHERE xa.tenant_id = #{ew.tenantId} AND xa.year_and_month = #{ew.yearAndMonth} and asset.ZCLB = '仪器设备'-->
|
|
|
+<!-- <if test="ew.xmmc!=null and ew.xmmc!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>-->
|
|
|
+<!-- <if test="ew.zcmc!=null and ew.zcmc!=''">and asset.zcmc like concat('%',#{ew.zcmc},'%')</if>-->
|
|
|
+<!-- <if test="ew.zclb!=null and ew.zclb!=''">and asset.zclb like concat('%',#{ew.zclb},'%')</if>-->
|
|
|
+<!-- <if test="ew.yt!=null and ew.yt!=''">and asset.yt like concat('%',#{ew.yt},'%')</if>-->
|
|
|
+<!-- <if test="ew.kssjMin!=null and ew.kssjMax!=''">and asset.kssj between #{ew.kssjMin} and #{ew.jssjEnd}</if>-->
|
|
|
+<!-- <if test="ew.zcyzMin!=null and ew.zcyzMax!=null">and asset.zcyz between #{ew.zcyzMin} and #{ew.zcyzMax}</if>-->
|
|
|
+<!-- <if test="ew.jczMin!=null and ew.jczMax!=null">and asset.jcz between #{ew.jczMin} and #{ew.jczMax}</if>-->
|
|
|
+<!-- <if test="ew.yzjeMin!=null and ew.yzjeMax!=null">and asset.jzje between #{ew.yzjeMin} and #{ew.yzjeMax}</if>-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
<select id="keyanyiqishebeizhejiufeiyongfenpeibiao"
|
|
|
resultMap="XmFixedAssetCostVo">
|
|
|
- SELECT xa.xm_id, xa.asset_id, xm.XMBH, xm.XMMC,
|
|
|
- asset.ZCBM as 'asset.ZCBM' ,asset.ZCMC as 'asset.ZCMC' ,asset.ZCLB as 'asset.ZCLB',
|
|
|
- asset.YT as 'asset.YT', asset.ZCYZ as 'asset.ZCYZ',asset.JCZ as 'asset.JCZ',asset.YZJE as 'asset.YZJE',asset.ZGS as 'asset.ZGS',asset.KSSJ as 'asset.KSSJ',
|
|
|
- kxah.work_hours
|
|
|
- FROM kd_xm_fixed_asset xa
|
|
|
- LEFT JOIN kd_asset asset ON xa.asset_id = asset.id
|
|
|
- LEFT JOIN
|
|
|
- (
|
|
|
- select xm_id, asset_id, left(work_date, 6) as year_and_month, ifnull(sum(work_hours),0) as work_hours
|
|
|
- from kd_xm_asset_hours
|
|
|
- group by xm_id, asset_id, left(work_date, 6)
|
|
|
- )as kxah on kxah.xm_id = xa.xm_id and kxah.asset_id = xa.asset_id and kxah.year_and_month= #{ew.yearAndMonth}
|
|
|
+ SELECT xm.XMBH, xm.XMMC,
|
|
|
+ v1.xm_id, v1.asset_id, v1.year_and_month,
|
|
|
+ v1.ZCBM as 'asset.ZCBM' , v1.ZCMC as 'asset.ZCMC', v1.ZCLB as 'asset.ZCLB' , v1.YT as 'asset.YT', v1.ZCYZ as 'asset.ZCYZ', v1.JCZ as 'asset.JCZ' , v1.YZJE as 'asset.YZJE', v1.zgs as 'asset.ZGS',
|
|
|
+ v1.work_hours,
|
|
|
+ v1.yanfa_fen_tan_lv, v1.yanfa_tan_xiao
|
|
|
+ from yisishebeiAssetCostView v1
|
|
|
LEFT JOIN
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -113,16 +141,16 @@
|
|
|
COALESCE( (SELECT bgrz.BGHDZ FROM kd_xm_bgrz bgrz WHERE bgrz.XM_ID = xm.id AND bgrz.ZDMC = 'XMBH' AND DATE_FORMAT(bgrz.BGSXSJ,'%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth} ORDER BY bgrz.BGSXSJ DESC LIMIT 1),XMBH) AS XMBH
|
|
|
FROM kd_xm xm
|
|
|
WHERE xm.is_deleted = 0
|
|
|
- ) xm on xm.id = xa.xm_id
|
|
|
- WHERE xa.tenant_id = #{ew.tenantId} AND xa.year_and_month = #{ew.yearAndMonth} and asset.ZCLB = '仪器设备'
|
|
|
+ ) xm on xm.id = v1.xm_id
|
|
|
+ WHERE v1.tenant_id = #{ew.tenantId} AND v1.year_and_month = #{ew.yearAndMonth}
|
|
|
<if test="ew.xmmc!=null and ew.xmmc!=''">and xm.xmmc like concat('%',#{ew.xmmc},'%')</if>
|
|
|
- <if test="ew.zcmc!=null and ew.zcmc!=''">and asset.zcmc like concat('%',#{ew.zcmc},'%')</if>
|
|
|
- <if test="ew.zclb!=null and ew.zclb!=''">and asset.zclb like concat('%',#{ew.zclb},'%')</if>
|
|
|
- <if test="ew.yt!=null and ew.yt!=''">and asset.yt like concat('%',#{ew.yt},'%')</if>
|
|
|
- <if test="ew.kssjMin!=null and ew.kssjMax!=''">and asset.kssj between #{ew.kssjMin} and #{ew.jssjEnd}</if>
|
|
|
- <if test="ew.zcyzMin!=null and ew.zcyzMax!=null">and asset.zcyz between #{ew.zcyzMin} and #{ew.zcyzMax}</if>
|
|
|
- <if test="ew.jczMin!=null and ew.jczMax!=null">and asset.jcz between #{ew.jczMin} and #{ew.jczMax}</if>
|
|
|
- <if test="ew.yzjeMin!=null and ew.yzjeMax!=null">and asset.jzje between #{ew.yzjeMin} and #{ew.yzjeMax}</if>
|
|
|
+ <if test="ew.zcmc!=null and ew.zcmc!=''">and zcmc like concat('%',#{ew.zcmc},'%')</if>
|
|
|
+ <if test="ew.zclb!=null and ew.zclb!=''">and zclb like concat('%',#{ew.zclb},'%')</if>
|
|
|
+ <if test="ew.yt!=null and ew.yt!=''">and yt like concat('%',#{ew.yt},'%')</if>
|
|
|
+ <if test="ew.kssjMin!=null and ew.kssjMax!=''">and kssj between #{ew.kssjMin} and #{ew.jssjEnd}</if>
|
|
|
+ <if test="ew.zcyzMin!=null and ew.zcyzMax!=null">and zcyz between #{ew.zcyzMin} and #{ew.zcyzMax}</if>
|
|
|
+ <if test="ew.jczMin!=null and ew.jczMax!=null">and jcz between #{ew.jczMin} and #{ew.jczMax}</if>
|
|
|
+ <if test="ew.yzjeMin!=null and ew.yzjeMax!=null">and jzje between #{ew.yzjeMin} and #{ew.yzjeMax}</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="keyanfangwujianzhuwuzhejiufeiyongfenpeibiao"
|
|
|
@@ -131,7 +159,8 @@
|
|
|
xa.id,xa.xm_id, xa.asset_id, xm.XMBH, xm.XMMC,
|
|
|
asset.ZCBM as 'asset.ZCBM' ,asset.ZCMC as 'asset.ZCMC' ,asset.ZCLB as 'asset.ZCLB',
|
|
|
asset.YT as 'asset.YT', asset.ZCYZ as 'asset.ZCYZ',asset.JCZ as 'asset.JCZ',asset.YZJE as 'asset.YZJE', asset.KSSJ as 'asset.KSSJ',
|
|
|
- xa.yfftv,xa.ftvqdyj
|
|
|
+ xa.yfftv as yanfa_fen_tan_lv,
|
|
|
+ xa.ftvqdyj
|
|
|
FROM kd_xm_fixed_asset xa
|
|
|
LEFT JOIN kd_asset asset ON xa.asset_id = asset.id
|
|
|
LEFT JOIN
|