达梦数据库sql改造
This commit is contained in:
parent
3e11b06818
commit
e91d926450
|
|
@ -243,15 +243,15 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getLightStatus" resultType="com.bonus.bmw.person.entity.ContractBean">
|
<select id="getLightStatus" resultType="com.bonus.bmw.person.entity.ContractBean">
|
||||||
SELECT
|
SELECT
|
||||||
bw.light_status AS lightStatus
|
bw."light_status" AS lightStatus
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_worker" bw
|
"ynrealname"."bm_worker" bw
|
||||||
WHERE bw.id_number = #{idNumber}
|
WHERE bw."id_number" = #{idNumber}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<delete id="delContract">
|
<delete id="delContract">
|
||||||
delete from "ynrealname"."bm_worker_contract" where "id" = #{id}
|
delete from "ynrealname"."bm_worker_contract" where "idCard" = #{idNumber}
|
||||||
;
|
;
|
||||||
delete from "ynrealname"."bm_worker_contract_details" where "id_card" = #{idNumber}
|
delete from "ynrealname"."bm_worker_contract_details" where "id_card" = #{idNumber}
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -97,12 +97,12 @@
|
||||||
<insert id="insertPersonToTeam">
|
<insert id="insertPersonToTeam">
|
||||||
update "ynrealname"."bm_team_user_relation" set "is_active" = '0' where "id_number" = #{idNumber};
|
update "ynrealname"."bm_team_user_relation" set "is_active" = '0' where "id_number" = #{idNumber};
|
||||||
INSERT INTO "ynrealname"."bm_team_user_relation"
|
INSERT INTO "ynrealname"."bm_team_user_relation"
|
||||||
("team_id", "id_number",is_regular_person, "IS_ACTIVE") VALUES (#{teamId},#{idNumber},#{isRegularPerson},'1');
|
("team_id", "id_number","is_regular_person", "is_active") VALUES (#{teamId},#{idNumber},#{isRegularPerson},'1');
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertPersonContractData">
|
<insert id="insertPersonContractData">
|
||||||
insert into bm_worker_contract
|
insert into "ynrealname"."bm_worker_contract"
|
||||||
(id,idCard,`name`,`post`, contractCode, laborContractType, role, contractValidDate, contractInvalidDate,
|
("id","idCard","name","post", "contractCode", "laborContractType", "role", "contractValidDate", "contractInvalidDate",
|
||||||
contractType, wageApprovedWay, wageCriterion, miurInsurance, whetherOnJob, endowmentInsurance
|
"contractType", "wageApprovedWay", "wageCriterion", "miurInsurance", "whetherOnJob", "endowmentInsurance"
|
||||||
<if test="contractType == '纸质合同'">
|
<if test="contractType == '纸质合同'">
|
||||||
,is_audit
|
,is_audit
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -118,11 +118,11 @@
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="replacePersonContractData">
|
<insert id="replacePersonContractData">
|
||||||
insert into bm_worker_contract
|
insert into "ynrealname"."bm_worker_contract"
|
||||||
(id,idCard,`name`,`post`, contractCode, laborContractType, role, contractValidDate, contractInvalidDate,
|
("id","idCard","name","post", "contractCode", "laborContractType", "role", "contractValidDate", "contractInvalidDate",
|
||||||
contractType, wageApprovedWay, wageCriterion, miurInsurance, whetherOnJob, endowmentInsurance
|
"contractType", "wageApprovedWay", "wageCriterion", "miurInsurance", "whetherOnJob", "endowmentInsurance"
|
||||||
<if test="contractType == '纸质合同'">
|
<if test="contractType == '纸质合同'">
|
||||||
,is_audit
|
,"is_audit"
|
||||||
</if>
|
</if>
|
||||||
)
|
)
|
||||||
select #{contractId}, #{idNumber},#{name}, #{postId},#{contractCode}, #{laborContractType}, #{role}, #{contractValidDate},
|
select #{contractId}, #{idNumber},#{name}, #{postId},#{contractCode}, #{laborContractType}, #{role}, #{contractValidDate},
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
</if>
|
</if>
|
||||||
from dual
|
from dual
|
||||||
where NOT EXISTS (
|
where NOT EXISTS (
|
||||||
select * from bm_worker_contract where id = #{contractId}
|
select * from "ynrealname"."bm_worker_contract" where "id" = #{contractId}
|
||||||
);
|
);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,13 +143,15 @@
|
||||||
AND bs."id" IS NOT NULL
|
AND bs."id" IS NOT NULL
|
||||||
LEFT JOIN "ynrealname"."fbeva_sub_project" fsp ON fsp."contract_id" = bsc."id"
|
LEFT JOIN "ynrealname"."fbeva_sub_project" fsp ON fsp."contract_id" = bsc."id"
|
||||||
WHERE
|
WHERE
|
||||||
WHERE
|
bs."id" IS NOT NULL
|
||||||
bsc."is_active" = '1'
|
AND fsp."eva_month" IS NOT NULL
|
||||||
AND td."value" = #{params.month} and fcpe."eva_date" is not null
|
/*AND td."value" = #{params.month} and fcpe."eva_date" is not null*/
|
||||||
<if test="params != null and params != ''">
|
<if test="params != null">
|
||||||
|
<!--
|
||||||
<if test="params.proId != null and params.proId != ''">
|
<if test="params.proId != null and params.proId != ''">
|
||||||
AND bp."id" =#{params.proId}
|
AND bp."id" =#{params.proId}
|
||||||
</if>
|
</if>
|
||||||
|
-->
|
||||||
<if test="params.subName != null and params.subName != ''">
|
<if test="params.subName != null and params.subName != ''">
|
||||||
AND bsc."contract_name" LIKE concat('%', #{params.subName}, '%')
|
AND bsc."contract_name" LIKE concat('%', #{params.subName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -158,18 +160,10 @@
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bs."sub_name"
|
bs."sub_name"
|
||||||
<if test="params.status != null and params.status != '' ">
|
<if test="params.status != null and params.status != '' ">
|
||||||
HAVING
|
having status = #{params.status}
|
||||||
CASE
|
|
||||||
WHEN COUNT(bs."sub_name") = 0 THEN 0
|
|
||||||
WHEN ROUND(SUM(fsp."eva_score") / COUNT(bs."sub_name"), 2) > 90 THEN 1
|
|
||||||
WHEN ROUND(SUM(fsp."eva_score") / COUNT(bs."sub_name"), 2) > 80 THEN 2
|
|
||||||
WHEN ROUND(SUM(fsp."eva_score") / COUNT(bs."sub_name"), 2) > 60 THEN 3
|
|
||||||
WHEN ROUND(SUM(fsp."eva_score") / COUNT(bs."sub_name"), 2) < 61 THEN 4
|
|
||||||
ELSE 0
|
|
||||||
END = #{params.status}
|
|
||||||
</if>
|
</if>
|
||||||
<if test="offset != null and offset >= 0 and limit != null and limit >= 0">
|
<if test="offset != null and offset >= 0 and limit != null and limit >= 0">
|
||||||
OFFSET #{offset} ROWS FETCH NEXT #{limit} ROWS ONLY
|
OFFSET #{offset, jdbcType=INTEGER} ROWS FETCH NEXT #{limit, jdbcType=INTEGER} ROWS ONLY
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getRankListCount" resultType="java.lang.Integer">
|
<select id="getRankListCount" resultType="java.lang.Integer">
|
||||||
|
|
@ -258,4 +252,4 @@ FROM
|
||||||
values (#{score},#{evaDate},#{evaId},#{type},#{uuid},#{reason})
|
values (#{score},#{evaDate},#{evaId},#{type},#{uuid},#{reason})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue