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