|
|
@@ -86,16 +86,16 @@
|
|
|
<resultMap id="XmIntangibleAssetCostVo" type="org.sky.scientific.pojo.vo.XmIntangibleAssetCostVo" extends="ResultMap">
|
|
|
<result column="attendanceHours" property="attendanceHours"/>
|
|
|
<result column="workHours" property="workHours"/>
|
|
|
+ <result column="yanfaFenTanLv" property="yanfaFenTanLv"/>
|
|
|
+ <result column="yanfaTanXiao" property="yanfaTanXiao"/>
|
|
|
</resultMap>
|
|
|
<select id="keyanwuxingzichantanxiaofeiyongfenpeibiao"
|
|
|
resultMap="XmIntangibleAssetCostVo">
|
|
|
SELECT
|
|
|
- xa.xm_id, xm.xmmc, xm.xmbh,
|
|
|
- xa.asset_id,asset.id as 'asset.id',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',
|
|
|
- kar.total_hours as attendanceHours,
|
|
|
- kxth.total_hours as workHours
|
|
|
- FROM kd_xm_intangible_asset xa
|
|
|
- LEFT JOIN kd_asset asset ON xa.asset_id = asset.id
|
|
|
+ v1.xm_id, xm.xmmc, xm.xmbh,
|
|
|
+ v1.asset_id, ZCBM as 'asset.ZCBM',ZCMC as 'asset.ZCMC', ZCLB as 'asset.ZCLB', GL as 'asset.GL',YT as 'asset.YT',ZCYZ as 'asset.ZCYZ',JCZ as 'asset.JCZ',YZJE as 'asset.YZJE',
|
|
|
+ v1.attendanceHours,v1.workHours,v1.yanfaFenTanLv,v1.yanfaTanXiao
|
|
|
+ FROM wuxingAssetCostView v1
|
|
|
LEFT JOIN
|
|
|
(
|
|
|
SELECT
|
|
|
@@ -103,32 +103,60 @@
|
|
|
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
|
|
|
- ) xm ON xm.id = xa.xm_id
|
|
|
- LEFT JOIN
|
|
|
- (
|
|
|
- SELECT
|
|
|
- unicode,LEFT(work_date, 6) AS year_and_month,IFNULL(SUM(work_hours), 0) AS total_hours
|
|
|
- FROM kd_attendance_records
|
|
|
- GROUP BY unicode, LEFT(work_date, 6)
|
|
|
- ) kar ON kar.unicode = xa.user_unicode AND kar.year_and_month = xa.year_and_month
|
|
|
- LEFT JOIN
|
|
|
- (
|
|
|
- SELECT
|
|
|
- unicode,xm_id,LEFT(work_date, 6) AS year_and_month,IFNULL(SUM(work_hours), 0) AS total_hours
|
|
|
- FROM kd_xm_technician_hours
|
|
|
- GROUP BY unicode, xm_id, LEFT(work_date, 6)
|
|
|
- ) kxth ON kxth.unicode = xa.user_unicode AND kxth.xm_id = xa.xm_id AND kxth.year_and_month = xa.year_and_month
|
|
|
- WHERE xa.tenant_id = #{ew.tenantId} AND xa.year_and_month = #{ew.yearAndMonth}
|
|
|
+ ) 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.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.attendanceHoursMin!=null and ew.attendanceHoursMax!=null">and kar.total_hours between #{ew.attendanceHoursMin} and #{ew.attendanceHoursMax}</if>
|
|
|
- <if test="ew.workHoursMin!=null and ew.workHoursMax!=null">and kxth.total_hours between #{ew.workHoursMin} and #{ew.workHoursMax}</if>
|
|
|
- </select>
|
|
|
+ <if test="ew.zcmc!=null and ew.zcmc!=''">and v1.zcmc like concat('%',#{ew.zcmc},'%')</if>
|
|
|
+ <if test="ew.zclb!=null and ew.zclb!=''">and v1.zclb like concat('%',#{ew.zclb},'%')</if>
|
|
|
+ <if test="ew.yt!=null and ew.yt!=''">and v1.yt like concat('%',#{ew.yt},'%')</if>
|
|
|
+ <if test="ew.zcyzMin!=null and ew.zcyzMax!=null">and v1.zcyz between #{ew.zcyzMin} and #{ew.zcyzMax}</if>
|
|
|
+ <if test="ew.jczMin!=null and ew.jczMax!=null">and v1.jcz between #{ew.jczMin} and #{ew.jczMax}</if>
|
|
|
+ <if test="ew.yzjeMin!=null and ew.yzjeMax!=null">and v1.jzje between #{ew.yzjeMin} and #{ew.yzjeMax}</if>
|
|
|
+ <if test="ew.attendanceHoursMin!=null and ew.attendanceHoursMax!=null">and v1.attendanceHours between #{ew.attendanceHoursMin} and #{ew.attendanceHoursMax}</if>
|
|
|
+ <if test="ew.workHoursMin!=null and ew.workHoursMax!=null">and v1.workHours between #{ew.workHoursMin} and #{ew.workHoursMax}</if>
|
|
|
+ </select>
|
|
|
+<!-- <select id="keyanwuxingzichantanxiaofeiyongfenpeibiao"-->
|
|
|
+<!-- resultMap="XmIntangibleAssetCostVo">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- xa.xm_id, xm.xmmc, xm.xmbh,-->
|
|
|
+<!-- xa.asset_id,asset.id as 'asset.id',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',-->
|
|
|
+<!-- kar.total_hours as attendanceHours,-->
|
|
|
+<!-- kxth.total_hours as workHours-->
|
|
|
+<!-- FROM kd_xm_intangible_asset xa-->
|
|
|
+<!-- LEFT JOIN kd_asset asset ON xa.asset_id = asset.id-->
|
|
|
+<!-- 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-->
|
|
|
+<!-- ) xm ON xm.id = xa.xm_id-->
|
|
|
+<!-- LEFT JOIN-->
|
|
|
+<!-- (-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- unicode,LEFT(work_date, 6) AS year_and_month,IFNULL(SUM(work_hours), 0) AS total_hours-->
|
|
|
+<!-- FROM kd_attendance_records-->
|
|
|
+<!-- GROUP BY unicode, LEFT(work_date, 6)-->
|
|
|
+<!-- ) kar ON kar.unicode = xa.user_unicode AND kar.year_and_month = xa.year_and_month-->
|
|
|
+<!-- LEFT JOIN-->
|
|
|
+<!-- (-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- unicode,xm_id,LEFT(work_date, 6) AS year_and_month,IFNULL(SUM(work_hours), 0) AS total_hours-->
|
|
|
+<!-- FROM kd_xm_technician_hours-->
|
|
|
+<!-- GROUP BY unicode, xm_id, LEFT(work_date, 6)-->
|
|
|
+<!-- ) kxth ON kxth.unicode = xa.user_unicode AND kxth.xm_id = xa.xm_id AND kxth.year_and_month = xa.year_and_month-->
|
|
|
+<!-- WHERE xa.tenant_id = #{ew.tenantId} AND xa.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.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.attendanceHoursMin!=null and ew.attendanceHoursMax!=null">and kar.total_hours between #{ew.attendanceHoursMin} and #{ew.attendanceHoursMax}</if>-->
|
|
|
+<!-- <if test="ew.workHoursMin!=null and ew.workHoursMax!=null">and kxth.total_hours between #{ew.workHoursMin} and #{ew.workHoursMax}</if>-->
|
|
|
+<!-- </select>-->
|
|
|
|
|
|
<delete id="physicalDeleteByIds">
|
|
|
DELETE FROM kd_xm_intangible_asset
|