|
@@ -45,9 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateUnit" column="update_unit" />
|
|
|
<result property="updateUnitName" column="update_unit_name" />
|
|
|
<result property="zzmc" column="zzmc" />
|
|
|
+ <result property="btkssj" column="btkssj" />
|
|
|
+ <result property="btjssj" column="btjssj" />
|
|
|
</resultMap>
|
|
|
|
|
|
-
|
|
|
<resultMap type="YljgYgJbxx" id="YljgHlyYgResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="jgId" column="jg_id" />
|
|
@@ -99,6 +100,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="updateUnitName" column="update_unit_name" />
|
|
|
<result property="zzmc" column="zzmc" />
|
|
|
<result property="htxxUrl" column="htxx_url" />
|
|
|
+ <result property="btkssj" column="btkssj" />
|
|
|
+ <result property="btjssj" column="btjssj" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="YljgYgHtxx" id="YljgYgHtxxResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="cyryId" column="cyry_id" />
|
|
|
+ <result property="jgId" column="jg_id" />
|
|
|
+ <result property="htmc" column="htmc" />
|
|
|
+ <result property="htkssj" column="htkssj" />
|
|
|
+ <result property="htjssj" column="htjssj" />
|
|
|
+ <result property="htxxUrl" column="htxx_url" />
|
|
|
+ <result property="bz" column="bz" />
|
|
|
+ <result property="createTimeStr" column="create_time_str" />
|
|
|
+ <result property="createUserId" column="create_user_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createUserType" column="create_user_type" />
|
|
|
+ <result property="createUnit" column="create_unit" />
|
|
|
+ <result property="createTounit" column="create_tounit" />
|
|
|
+ <result property="createBmjsc" column="create_bmjsc" />
|
|
|
+ <result property="createQhjsc" column="create_qhjsc" />
|
|
|
+ <result property="createUnitName" column="create_unit_name" />
|
|
|
+ <result property="createAreaCode" column="create_area_code" />
|
|
|
+ <result property="updateTimeStr" column="update_time_str" />
|
|
|
+ <result property="updateUserId" column="update_user_id" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateUnit" column="update_unit" />
|
|
|
+ <result property="updateUnitName" column="update_unit_name" />
|
|
|
+ <result property="state" column="state" />
|
|
|
+ <result property="gwStart" column="gwStart" />
|
|
|
+ <result property="gwYear1" column="gwYear1" />
|
|
|
+ <result property="gwYear2" column="gwYear2" />
|
|
|
+ <result property="gwFfys" column="gwFfys" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectYljgYgJbxxVo">
|
|
@@ -108,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
a.is_hlyyzs, a.is_jnsb, a.hlydj, a.gq_hlydj, a.jg_id, a.zw, a.sfzhm_url, a.whcd_url,
|
|
|
a.create_time_str, a.create_user_id, a.create_by, a.create_unit,a.create_tounit,a.create_bmjsc,a.create_qhjsc, a.create_unit_name,
|
|
|
a.update_time_str, a.update_user_id, a.update_by, a.update_unit, a.update_unit_name,
|
|
|
- b.zzmc
|
|
|
+ a.jtff_zt, b.zzmc
|
|
|
from yljg_yg_jbxx a
|
|
|
LEFT JOIN yljg_bmxx b ON a.shbn = b.id
|
|
|
</sql>
|
|
@@ -140,6 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select
|
|
|
a.id, xm, a.sfzlx, a.sfzhm, a.xb, a.lxdh, a.whcd, a.shbn,
|
|
|
a.zylx, a.zylx_qt, a.gwlx,
|
|
|
+ a.btkssj, a.btjssj ,
|
|
|
+ (SELECT MIN(htkssj) FROM YLJG_YG_HTXX WHERE cyry_id = a.id) AS htkssj,
|
|
|
+ (SELECT MAX(htjssj) FROM YLJG_YG_HTXX WHERE cyry_id = a.id) AS htjssj,
|
|
|
a.is_hlyyzs, a.hlydj, a.gq_hlydj, a.jg_id, a.zw, a.hly_jtff_shyj,
|
|
|
a.create_time_str, a.create_user_id, a.create_by, a.create_unit,a.create_tounit,a.create_bmjsc,a.create_qhjsc, a.create_unit_name,
|
|
|
a.update_time_str, a.update_user_id, a.update_by, a.update_unit, a.update_unit_name,
|
|
@@ -150,6 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
zylx = '01'
|
|
|
AND a.is_jnsb = '01'
|
|
|
AND a.is_sybz = '0'
|
|
|
+ AND a.btkssj IS NOT NULL
|
|
|
AND a.state = '1'
|
|
|
AND a.zzzt = '1'
|
|
|
AND a.jg_id in (
|
|
@@ -186,34 +224,138 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <!-- 护理员津贴奖励信息-->
|
|
|
-<!-- IFNULL(-->
|
|
|
-<!-- (TIMESTAMPDIFF(YEAR,-->
|
|
|
-<!-- (SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id),-->
|
|
|
-<!-- (SELECT MAX(htjssj) FROM yljg_yg_htxx WHERE cyry_id = A.id))),0) AS hlyCynx,-->
|
|
|
+
|
|
|
<select id="selectYljgHlyJtjlById" parameterType="String" resultType="java.util.Map">
|
|
|
- select
|
|
|
- YEAR(NOW()) AS yearNow,
|
|
|
- IFNULL(DATE_FORMAT((SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id),'%Y'),DATE_FORMAT(NOW(),'%Y')) as gwStart,
|
|
|
- IFNULL((YEAR(NOW()) - YEAR((SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id))),0) AS hlyCynx,
|
|
|
- (SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id) AS htkssj,
|
|
|
- (SELECT MAX(htjssj) FROM yljg_yg_htxx WHERE cyry_id = A.id) AS htjssj,
|
|
|
+ SELECT
|
|
|
+ ffrq,ffyf, ffYear, htStartYear, rzjtLx, isHlyyzs, hlydj,
|
|
|
+ get_hly_btje_gw(ffrq,ffyf) as gwbt
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ (
|
|
|
+ CASE
|
|
|
+ WHEN TIMESTAMPDIFF(MONTH, if(btkssj <= 20200101,'20230101',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y-%m-%d')), DATE_FORMAT(btjssj,'%Y-%m-%d')) <= 0
|
|
|
+ THEN 0
|
|
|
+ WHEN TIMESTAMPDIFF(MONTH, if(btkssj <= 20200101,'20230101',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y-%m-%d')), DATE_FORMAT(btjssj,'%Y-%m-%d')) > 0
|
|
|
+ AND TIMESTAMPDIFF(MONTH, if(btkssj <= 20200101,'20230101',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y-%m-%d')), DATE_FORMAT(btjssj,'%Y-%m-%d')) <=60
|
|
|
+ THEN TIMESTAMPDIFF(MONTH, if(btkssj <= 20200101,'20230101',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y-%m-%d')), DATE_FORMAT(btjssj,'%Y-%m-%d')) + 1
|
|
|
+ WHEN TIMESTAMPDIFF(MONTH, if(btkssj <= 20200101,'20230101',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y-%m-%d')), DATE_FORMAT(btjssj,'%Y-%m-%d')) >60
|
|
|
+ THEN 60
|
|
|
+ ELSE 0
|
|
|
+ END
|
|
|
+ ) as ffyf, is_hlyyzs as isHlyyzs,
|
|
|
+ if(btkssj <= 20200101,'2023',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y')) as ffYear,
|
|
|
+ if(btkssj <= 20200101,'202301',DATE_FORMAT(DATE_ADD(btkssj, INTERVAL 3 YEAR),'%Y%m')) as ffrq,
|
|
|
+ DATE_FORMAT(btkssj,'%Y') AS htStartYear, hlydj, IFNULL(a.hdyr_jlms,'暂无信息') as hdyrJlms,
|
|
|
(CASE
|
|
|
WHEN a.is_scrz = '1' AND a.whcd = '20' THEN 1
|
|
|
WHEN a.is_scrz = '1' AND a.whcd = '30' THEN 2
|
|
|
WHEN a.is_scrz = '1' AND a.whcd IN ('40','60') THEN 3
|
|
|
WHEN a.is_tsknqt = '1' THEN 4 ELSE 0
|
|
|
- END) AS rzjtLx,
|
|
|
- IFNULL(a.hdyr_jlms,'暂无信息') as hdyrJlms, a.hly_jtff_shyj as hlyJtffShyj, a.hly_jtff_shrxm as hlyJtffShrxm,
|
|
|
- a.id, a.jg_id, xm, a.sfzlx, a.sfzhm, a.csrq, a.cyrq, a.xb, a.lxdh, a.whcd, a.shbn,
|
|
|
- a.zzzt, a.lzsj, a.rzsj, a.zylx, a.zylx_qt as zylxQt, a.gwlx, a.jtff_zt as jtffZt, a.is_qy as isQy,
|
|
|
- a.is_hlyyzs as isHlyyzs, a.is_jnsb as isJnsb, a.hlydj, a.gq_hlydj as gqHlydj, a.jg_id as jgId, a.zw,
|
|
|
- a.sfzhm_url as sfzhmUrl, a.whcd_url as whcdUrl, a.is_scrz as isScrz, a.is_scrz_url as isScrzUrl,
|
|
|
- a.is_sybz as isSybz, a.is_tsknqt as isTsknqt
|
|
|
- from yljg_yg_jbxx a
|
|
|
- where a.id = #{id}
|
|
|
+ END) AS rzjtLx
|
|
|
+ FROM YLJG_YG_JBXX a
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ ) AA
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- <select id="selectYljgHlyJtjlById" parameterType="String" resultType="java.util.Map">-->
|
|
|
+<!-- select-->
|
|
|
+<!-- YEAR(NOW()) AS yearNow,-->
|
|
|
+<!-- IFNULL(DATE_FORMAT((SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id),'%Y-%m'),DATE_FORMAT(NOW(),'%Y-%m')) as gwStart,-->
|
|
|
+<!-- IFNULL((YEAR(NOW()) - YEAR((SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id))),0) AS hlyCynx,-->
|
|
|
+<!-- (SELECT MIN(htkssj) FROM yljg_yg_htxx WHERE cyry_id = A.id) AS htkssj,-->
|
|
|
+<!-- (SELECT MAX(htjssj) FROM yljg_yg_htxx WHERE cyry_id = A.id) AS htjssj,-->
|
|
|
+<!-- (CASE-->
|
|
|
+<!-- WHEN a.is_scrz = '1' AND a.whcd = '20' THEN 1-->
|
|
|
+<!-- WHEN a.is_scrz = '1' AND a.whcd = '30' THEN 2-->
|
|
|
+<!-- WHEN a.is_scrz = '1' AND a.whcd IN ('40','60') THEN 3-->
|
|
|
+<!-- WHEN a.is_tsknqt = '1' THEN 4 ELSE 0-->
|
|
|
+<!-- END) AS rzjtLx,-->
|
|
|
+<!-- IFNULL(a.hdyr_jlms,'暂无信息') as hdyrJlms, a.hly_jtff_shyj as hlyJtffShyj, a.hly_jtff_shrxm as hlyJtffShrxm,-->
|
|
|
+<!-- a.id, a.jg_id, xm, a.sfzlx, a.sfzhm, a.csrq, a.cyrq, a.xb, a.lxdh, a.whcd, a.shbn,-->
|
|
|
+<!-- a.zzzt, a.lzsj, a.rzsj, a.zylx, a.zylx_qt as zylxQt, a.gwlx, a.jtff_zt as jtffZt, a.is_qy as isQy,-->
|
|
|
+<!-- a.is_hlyyzs as isHlyyzs, a.is_jnsb as isJnsb, a.hlydj, a.gq_hlydj as gqHlydj, a.jg_id as jgId, a.zw,-->
|
|
|
+<!-- a.sfzhm_url as sfzhmUrl, a.whcd_url as whcdUrl, a.is_scrz as isScrz, a.is_scrz_url as isScrzUrl,-->
|
|
|
+<!-- a.is_sybz as isSybz, a.is_tsknqt as isTsknqt-->
|
|
|
+<!-- from yljg_yg_jbxx a-->
|
|
|
+<!-- where a.id = #{id}-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
+ <select id="selectYljgHtxxById" parameterType="String" resultMap="YljgYgHtxxResult">
|
|
|
+
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+<!-- <select id="selectYljgHtxxById" parameterType="String" resultMap="YljgYgHtxxResult">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- htkssj, ffrqYM AS gwStart, htjssj, gwStartMonth, gwEndYM, gwEndMonth, ffyf AS gwFfys, dj,-->
|
|
|
+<!-- (-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- WHEN dj=1 AND 13-gwStartMonth >= ffyf-->
|
|
|
+<!-- THEN 50 * ffyf-->
|
|
|
+<!-- ELSE 50 * (13-gwStartMonth)-->
|
|
|
+<!-- END-->
|
|
|
+<!-- ) AS gwYear1,-->
|
|
|
+<!-- (-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- WHEN dj=1 AND 13-gwStartMonth >= ffyf-->
|
|
|
+<!-- THEN 0-->
|
|
|
+<!-- WHEN dj=1 AND 12-gwStartMonth < ffyf-->
|
|
|
+<!-- THEN (ffyf-13+gwStartMonth) * 50-->
|
|
|
+<!-- WHEN dj=2 AND ffyf-12 <= 12-gwStartMonth+1-->
|
|
|
+<!-- THEN (gwStartMonth-1) * 50 + (ffyf-12) * 100-->
|
|
|
+<!-- ELSE (gwStartMonth-1) * 50 + (13-gwStartMonth) * 100-->
|
|
|
+<!-- END-->
|
|
|
+<!-- ) AS gwYear2-->
|
|
|
+<!-- FROM-->
|
|
|
+<!-- (-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- htkssj, DATE_FORMAT(ffrq,'%Y-%m') AS ffrqYM, htjssj, gwStartMonth, gwEndYM, gwEndMonth,-->
|
|
|
+<!-- (-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- WHEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) <= 0-->
|
|
|
+<!-- THEN 0-->
|
|
|
+<!-- WHEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) > 0 AND TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) <=60-->
|
|
|
+<!-- THEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) + 1-->
|
|
|
+<!-- WHEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) >60-->
|
|
|
+<!-- THEN 60-->
|
|
|
+<!-- ELSE 0-->
|
|
|
+<!-- END-->
|
|
|
+<!-- ) as ffyf,-->
|
|
|
+<!-- (-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- WHEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) <= 0-->
|
|
|
+<!-- THEN 0-->
|
|
|
+<!-- WHEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) > 0 AND TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) <=59-->
|
|
|
+<!-- THEN CEIL((TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) + 1)/12)-->
|
|
|
+<!-- WHEN TIMESTAMPDIFF(MONTH, ffrq, DATE_FORMAT(htjssj,'%Y-%m-%d')) >59-->
|
|
|
+<!-- THEN 6-->
|
|
|
+<!-- ELSE 0-->
|
|
|
+<!-- END-->
|
|
|
+<!-- ) as dj-->
|
|
|
+<!-- FROM-->
|
|
|
+<!-- (-->
|
|
|
+<!-- select htkssj, htjssj,-->
|
|
|
+<!-- (-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- WHEN htkssj <= 20200101-->
|
|
|
+<!-- THEN '2023-01-01'-->
|
|
|
+<!-- WHEN htkssj > 20200101-->
|
|
|
+<!-- THEN DATE_FORMAT(DATE_ADD(htkssj, INTERVAL 3 YEAR),'%Y-%m-%d')-->
|
|
|
+<!-- END-->
|
|
|
+<!-- ) as ffrq,-->
|
|
|
+<!-- DATE_FORMAT(IF(htkssj <= 20200101,20230101,htkssj),'%m') AS gwStartMonth,-->
|
|
|
+<!-- DATE_FORMAT(htjssj,'%Y%m') AS gwEndYM,-->
|
|
|
+<!-- DATE_FORMAT(htjssj,'%m') AS gwEndMonth-->
|
|
|
+<!-- from yljg_yg_htxx-->
|
|
|
+<!-- where cyry_id = #{id} and jg_id = #{jgId}-->
|
|
|
+<!-- ORDER BY HTKSSJ ASC-->
|
|
|
+<!-- ) AA-->
|
|
|
+<!-- ) BB-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
<select id="selectCommonYljgYgJbxxById" parameterType="String" resultMap="YljgYgJbxxResult">
|
|
|
select * from yljg_yg_jbxx where id = #{id}
|
|
|
</select>
|
|
@@ -360,6 +502,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="jgId != null">jg_id = #{jgId},</if>
|
|
|
<if test="zw != null">zw = #{zw},</if>
|
|
|
<if test="isQy != null">is_qy = #{isQy},</if>
|
|
|
+ <if test="btkssj != null and btkssj != 'empty'">btkssj = #{btkssj},</if>
|
|
|
+ <if test="btjssj != null and btjssj != 'empty'">btjssj = #{btjssj},</if>
|
|
|
+ <if test="btkssj != null and btkssj == 'empty'">btkssj = NULL,</if>
|
|
|
+ <if test="btjssj != null and btjssj == 'empty'">btjssj = NULL,</if>
|
|
|
update_time_str = #{updateTimeStr},
|
|
|
update_user_id = #{updateUserId},
|
|
|
update_by = #{updateBy},
|