SQL 修改
This commit is contained in:
parent
a55fe26ec1
commit
885148352b
|
|
@ -19,25 +19,25 @@ public interface SubContractDao {
|
||||||
|
|
||||||
List<SubContractBean> list(@Param("params")Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
List<SubContractBean> list(@Param("params")Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||||
|
|
||||||
@Select("SELECT id,contract_name AS contractName FROM bm_sub_contract where contract_name = #{name} and is_active = '1'")
|
@Select("SELECT \"id\", \"contract_name\" AS contractName FROM \"ynrealname\".\"bm_sub_contract\" where \"contract_name\" = #{name} and \"is_active\" = '1'")
|
||||||
SubContractBean getByName(String name);
|
SubContractBean getByName(String name);
|
||||||
|
|
||||||
@Options(useGeneratedKeys = true, keyProperty = "id")
|
@SelectKey(statement = "SELECT @@IDENTITY", keyProperty = "id", before = false, resultType = Long.class)
|
||||||
@Insert("INSERT INTO `bm_sub_contract`(`pro_id`, `sub_id`, `contract_name`, `contract_money`, `IS_ACTIVE`) VALUES (#{proId}, #{subId}, #{contractName}, #{contractMoney}, '1')")
|
@Insert("INSERT INTO \"ynrealname\".\"bm_sub_contract\"(\"pro_id\", \"sub_id\", \"contract_name\", \"contract_money\", \"is_active\") VALUES (#{proId}, #{subId}, #{contractName}, #{contractMoney}, '1')")
|
||||||
int save(SubContractBean o);
|
int save(SubContractBean o);
|
||||||
|
|
||||||
@Select("select id,NAME AS companyName,type_id as unitType,legal_person as represent,`legal_phone` as representPhone, `legal_idnumber` as representIdNumber, register_date as registerDate, address from `pm_company` where id = #{id}")
|
@Select("select \"id\", \"name\" AS companyName, \"type_id\" as unitType, \"legal_person\" as represent, \"legal_phone\" as representPhone, \"legal_idnumber\" as representIdNumber, \"register_date\" as registerDate, \"address\" from \"ynrealname\".\"pm_company\" where \"id\" = #{id}")
|
||||||
SubContractBean getCompanyById(Long id);
|
SubContractBean getCompanyById(Long id);
|
||||||
|
|
||||||
int update(SubContractBean o);
|
int update(SubContractBean o);
|
||||||
|
|
||||||
@Select("select ID as companyId,NAME as companyName from pm_company where IS_ACTIVE = '1'")
|
@Select("select \"id\" as companyId, \"name\" as companyName from \"ynrealname\".\"pm_company\" where \"is_active\" = '1'")
|
||||||
List<ProjectBean> getCompanyKeyValue();
|
List<ProjectBean> getCompanyKeyValue();
|
||||||
|
|
||||||
@Update("update bm_sub_contract set is_active = '0' where id = #{id}")
|
@Update("update \"ynrealname\".\"bm_sub_contract\" set \"is_active\" = '0' where \"id\" = #{id}")
|
||||||
int delete(Long id);
|
int delete(Long id);
|
||||||
|
|
||||||
@Update("update bm_sub_relation set is_active = '0' where sub_contract_id = #{id}")
|
@Update("update \"ynrealname\".\"bm_sub_relation\" set \"is_active\" = '0' where \"sub_contract_id\" = #{id}")
|
||||||
int deleteRelation(Long id);
|
int deleteRelation(Long id);
|
||||||
|
|
||||||
List<SelectTeamBean> getTeamAndPersonList(@Param("params")Map<String, Object> params);
|
List<SelectTeamBean> getTeamAndPersonList(@Param("params")Map<String, Object> params);
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@ public interface TeamBasicDao {
|
||||||
|
|
||||||
List<TeamBean> list(@Param("params")Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
List<TeamBean> list(@Param("params")Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||||
|
|
||||||
@Select("SELECT id,NAME AS subCompanyName FROM pm_dept where name = #{companyName}")
|
@Select("SELECT \"id\", \"name\" AS subCompanyName FROM \"ynrealname\".\"pm_dept\" where \"name\" = #{companyName}")
|
||||||
SubCompanyBean getCompanyByName(String companyName);
|
SubCompanyBean getCompanyByName(String companyName);
|
||||||
|
|
||||||
@Options(useGeneratedKeys = true,keyProperty = "id")
|
@SelectKey(statement = "SELECT @@IDENTITY", keyProperty = "id", before = false, resultType = Long.class)
|
||||||
@Insert("INSERT INTO `bm_sub_team`(`team_name`, `sub_id`, `team_idnumber`, `IS_ACTIVE`) VALUES (#{teamName}, #{subId}, #{foremanIdNumber}, '1')")
|
@Insert("INSERT INTO \"ynrealname\".\"bm_sub_team\"(\"team_name\", \"sub_id\", \"team_Idnumber\", \"is_active\") VALUES (#{teamName}, #{subId}, #{foremanIdNumber}, '1')")
|
||||||
int save(TeamBean o);
|
int save(TeamBean o);
|
||||||
|
|
||||||
TeamBean getById(Long id);
|
TeamBean getById(Long id);
|
||||||
|
|
@ -28,7 +28,7 @@ public interface TeamBasicDao {
|
||||||
|
|
||||||
List<TeamBean> getTeamSelect();
|
List<TeamBean> getTeamSelect();
|
||||||
|
|
||||||
@Update("update `bm_sub_team` set is_active = '0' where id = #{id}")
|
@Update("update \"ynrealname\".\"bm_sub_team\" set \"is_active\" = '0' where \"id\" = #{id}")
|
||||||
int delete(Long id);
|
int delete(Long id);
|
||||||
|
|
||||||
List<BasePersonBean> personList(@Param("params")Map<String, Object> params);
|
List<BasePersonBean> personList(@Param("params")Map<String, Object> params);
|
||||||
|
|
@ -55,6 +55,6 @@ public interface TeamBasicDao {
|
||||||
|
|
||||||
int addPerson(List<TeamBean> listTeam);
|
int addPerson(List<TeamBean> listTeam);
|
||||||
|
|
||||||
@Select("select count(1) from bm_sub_team WHERE team_name = #{teamName} and is_active = '1'")
|
@Select("select count(1) from \"ynrealname\".\"bm_sub_team\" WHERE \"team_name\" = #{teamName} and \"is_active\" = '1'")
|
||||||
int getTeamNumberByName(TeamBean o);
|
int getTeamNumberByName(TeamBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<mapper namespace="com.bonus.bmw.subContractor.dao.SubContractDao">
|
<mapper namespace="com.bonus.bmw.subContractor.dao.SubContractDao">
|
||||||
|
|
||||||
<sql id="where">
|
<sql id="where">
|
||||||
where bsc."IS_ACTIVE" = '1'
|
where bsc."is_active" = '1'
|
||||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel < 3">
|
<if test="params.orgId != null and params.orgId != '' and params.roleLevel < 3">
|
||||||
AND po."id" in (${params.orgAll})
|
AND po."id" in (${params.orgAll})
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and (
|
and (
|
||||||
bs."sub_name" like concat('%', #{params.keyWord}, '%')
|
bs."sub_name" like '%' || #{params.keyWord} || '%'
|
||||||
or bp."name" like concat('%', #{params.keyWord}, '%')
|
or bp."name" like '%' || #{params.keyWord} || '%'
|
||||||
or su."username" like concat('%', #{params.keyWord}, '%')
|
or su."username" like '%' || #{params.keyWord} || '%'
|
||||||
or bsc."contract_name" like concat('%', #{params.keyWord}, '%')
|
or bsc."contract_name" like '%' || #{params.keyWord} || '%'
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -131,7 +131,7 @@ select count(1) from (
|
||||||
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr3."v" and bst."is_active" = '1'
|
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr3."v" and bst."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id" and btur."is_active" = '1'
|
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id" and btur."is_active" = '1'
|
||||||
<include refid="where" />
|
<include refid="where" />
|
||||||
GROUP BY bsc."id"
|
GROUP BY bsc."id", bsc."contract_name", bs."sub_name", bp."name", bsc."is_complete", bsc."contract_money", su."username"
|
||||||
<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} ROWS FETCH NEXT #{limit} ROWS ONLY
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -152,12 +152,12 @@ select count(1) from (
|
||||||
and bst."sub_id" = #{params.subId} and bsr."value" is null
|
and bst."sub_id" = #{params.subId} and bsr."value" is null
|
||||||
</if>
|
</if>
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and bst."team_name" like concat('%', #{params.keyWord}, '%')
|
and bst."team_name" like '%' || #{params.keyWord} || '%'
|
||||||
</if>
|
</if>
|
||||||
<if test="params.teamIds != null and params.teamIds != ''">
|
<if test="params.teamIds != null and params.teamIds != ''">
|
||||||
and bst."id" in (${params.teamIds})
|
and bst."id" in (${params.teamIds})
|
||||||
</if>
|
</if>
|
||||||
GROUP BY bst."id"
|
GROUP BY bst."id", bst."team_name"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getById" resultType="com.bonus.bmw.subContractor.entity.SubContractBean">
|
<select id="getById" resultType="com.bonus.bmw.subContractor.entity.SubContractBean">
|
||||||
|
|
@ -169,7 +169,7 @@ select count(1) from (
|
||||||
bsc."contract_money" as contractMoney
|
bsc."contract_money" as contractMoney
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_sub_contract" bsc
|
"ynrealname"."bm_sub_contract" bsc
|
||||||
where bsc."IS_ACTIVE" = '1' and bsc."id" = #{id}
|
where bsc."is_active" = '1' and bsc."id" = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="getRelationById" resultType="com.bonus.bmw.subContractor.entity.SubContractRelationBean">
|
<select id="getRelationById" resultType="com.bonus.bmw.subContractor.entity.SubContractRelationBean">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -178,7 +178,7 @@ select count(1) from (
|
||||||
"value"
|
"value"
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_sub_relation"
|
"ynrealname"."bm_sub_relation"
|
||||||
where "IS_ACTIVE" = '1' and "sub_contract_id" = #{id}
|
where "is_active" = '1' and "sub_contract_id" = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="teamCount" resultType="java.lang.Integer">
|
<select id="teamCount" resultType="java.lang.Integer">
|
||||||
|
|
@ -187,24 +187,24 @@ select count(1) from (
|
||||||
bsc."id",
|
bsc."id",
|
||||||
bst."id" as teamId,
|
bst."id" as teamId,
|
||||||
bst."team_name" AS teamName,
|
bst."team_name" AS teamName,
|
||||||
WM_CONCAT( bw."NAME" ) AS person
|
WM_CONCAT( bw."name" ) AS person
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_sub_contract" bsc
|
"ynrealname"."bm_sub_contract" bsc
|
||||||
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
||||||
AND bsr."type" = '3'
|
AND bsr."type" = '3'
|
||||||
AND bsr."IS_ACTIVE" = '1'
|
AND bsr."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
||||||
AND bst."is_active" = '1'
|
AND bst."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
||||||
AND btur."IS_ACTIVE" = '1'
|
AND btur."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
||||||
AND bw."IS_ACTIVE" = '1'
|
AND bw."is_active" = '1'
|
||||||
WHERE
|
WHERE
|
||||||
bsc."IS_ACTIVE" = '1'
|
bsc."is_active" = '1'
|
||||||
AND bst."team_name" IS NOT NULL
|
AND bst."team_name" IS NOT NULL
|
||||||
and bsc."id" = #{params.id}
|
and bsc."id" = #{params.id}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bst."id"
|
bsc."id", bst."id", bst."team_name"
|
||||||
)a
|
)a
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -214,24 +214,24 @@ select count(1) from (
|
||||||
bsc."sub_id" as subId,
|
bsc."sub_id" as subId,
|
||||||
bst."id" as teamId,
|
bst."id" as teamId,
|
||||||
bst."team_name" AS teamName,
|
bst."team_name" AS teamName,
|
||||||
WM_CONCAT( bw."NAME" ) AS person
|
WM_CONCAT( bw."name" ) AS person
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_sub_contract" bsc
|
"ynrealname"."bm_sub_contract" bsc
|
||||||
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
||||||
AND bsr."type" = '3'
|
AND bsr."type" = '3'
|
||||||
AND bsr."IS_ACTIVE" = '1'
|
AND bsr."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
||||||
AND bst."is_active" = '1'
|
AND bst."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
||||||
AND btur."IS_ACTIVE" = '1'
|
AND btur."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
||||||
AND bw."IS_ACTIVE" = '1'
|
AND bw."is_active" = '1'
|
||||||
WHERE
|
WHERE
|
||||||
bsc."IS_ACTIVE" = '1'
|
bsc."is_active" = '1'
|
||||||
AND bst."team_name" IS NOT NULL
|
AND bst."team_name" IS NOT NULL
|
||||||
and bsc."id" = #{params.id}
|
and bsc."id" = #{params.id}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bst."id"
|
bsc."id", bsc."sub_id", bst."id", bst."team_name"
|
||||||
<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} ROWS FETCH NEXT #{limit} ROWS ONLY
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -243,39 +243,39 @@ select count(1) from (
|
||||||
"ynrealname"."bm_sub_contract" bsc
|
"ynrealname"."bm_sub_contract" bsc
|
||||||
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
||||||
AND bsr."type" = '3'
|
AND bsr."type" = '3'
|
||||||
AND bsr."IS_ACTIVE" = '1'
|
AND bsr."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
||||||
AND bst."is_active" = '1'
|
AND bst."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
||||||
AND btur."IS_ACTIVE" = '1'
|
AND btur."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
||||||
AND bw."IS_ACTIVE" = '1'
|
AND bw."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker_contract" bwc ON bw."id_number" = bwc."idCard" and bwc."is_active" = '1' and bwc."is_audit" = '1'
|
LEFT JOIN "ynrealname"."bm_worker_contract" bwc ON bw."id_number" = bwc."idCard" and bwc."is_active" = '1' and bwc."is_audit" = '1'
|
||||||
WHERE
|
WHERE
|
||||||
bsc."IS_ACTIVE" = '1'
|
bsc."is_active" = '1'
|
||||||
and bsc."id"= #{params.id}
|
and bsc."id"= #{params.id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getPersonList" resultType="com.bonus.bmw.subContractor.entity.SelectTeamBean">
|
<select id="getPersonList" resultType="com.bonus.bmw.subContractor.entity.SelectTeamBean">
|
||||||
SELECT
|
SELECT
|
||||||
bw."NAME" AS person,
|
bw."name" AS person,
|
||||||
bw."id_number" as idNumber,
|
bw."id_number" as idNumber,
|
||||||
bst."team_name" AS teamName,
|
bst."team_name" AS teamName,
|
||||||
bwc."idCard" as contract
|
bwc."id_card" as contract
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_sub_contract" bsc
|
"ynrealname"."bm_sub_contract" bsc
|
||||||
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
||||||
AND bsr."type" = '3'
|
AND bsr."type" = '3'
|
||||||
AND bsr."IS_ACTIVE" = '1'
|
AND bsr."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."id" = bsr."value"
|
||||||
AND bst."is_active" = '1'
|
AND bst."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id"
|
||||||
AND btur."IS_ACTIVE" = '1'
|
AND btur."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
LEFT JOIN "ynrealname"."bm_worker" bw ON btur."id_number" = bw."id_number"
|
||||||
AND bw."IS_ACTIVE" = '1'
|
AND bw."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker_contract" bwc ON bw."id_number" = bwc."idCard" and bwc."is_active" = '1' and bwc."is_audit" = '1'
|
LEFT JOIN "ynrealname"."bm_worker_contract" bwc ON bw."id_number" = bwc."id_card" and bwc."is_active" = '1' and bwc."is_audit" = '1'
|
||||||
WHERE
|
WHERE
|
||||||
bsc."IS_ACTIVE" = '1'
|
bsc."is_active" = '1'
|
||||||
and bsc."id"= #{params.id}
|
and bsc."id"= #{params.id}
|
||||||
and bw."id_number" is not null
|
and bw."id_number" is not null
|
||||||
<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">
|
||||||
|
|
@ -296,7 +296,7 @@ select count(1) from (
|
||||||
LEFT JOIN "ynrealname"."bm_worker" bw on bw."id_number" = btur."id_number" and bw."is_active" = '1'
|
LEFT JOIN "ynrealname"."bm_worker" bw on bw."id_number" = btur."id_number" and bw."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."sys_user" su ON su."phone" = bw."phone" and su."is_active" = '1'
|
LEFT JOIN "ynrealname"."sys_user" su ON su."phone" = bw."phone" and su."is_active" = '1'
|
||||||
WHERE btur."team_id" = #{teamId} and btur."is_active" = '1'
|
WHERE btur."team_id" = #{teamId} and btur."is_active" = '1'
|
||||||
GROUP BY bw."phone"
|
GROUP BY bw."name", btur."id_number", bw."phone", NVL(su."phone",'-1'), su."id"
|
||||||
</select>
|
</select>
|
||||||
<select id="getOrgRoleId" resultType="com.bonus.bmw.subContractor.entity.OrgRoleBean">
|
<select id="getOrgRoleId" resultType="com.bonus.bmw.subContractor.entity.OrgRoleBean">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,8 @@
|
||||||
<update id="updateIdNumberRelevanceData">
|
<update id="updateIdNumberRelevanceData">
|
||||||
update "ynrealname"."bm_certificate_read" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_certificate_read" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_worker_certificate" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_certificate" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_worker_contract" set "id_card" = #{idNumber} where "id_card" = #{id};
|
update "ynrealname"."bm_worker_contract" set idCard = #{idNumber} where idCard = #{id};
|
||||||
update "ynrealname"."bm_worker_contract_details" set "id_card" = #{idNumber} where "id_card" = #{id};
|
update "ynrealname"."bm_worker_contract_details" set id_card = #{idNumber} where id_card = #{id};
|
||||||
update "ynrealname"."bm_worker_contract_witness" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_contract_witness" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_worker_ein_history" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_ein_history" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_worker_give" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_give" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
|
|
@ -96,9 +96,9 @@
|
||||||
update "ynrealname"."bm_worker_payroll" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_payroll" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_worker_photo" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_photo" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_worker_train" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_worker_train" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."bm_sub_team" set "team_idnumber" = #{idNumber} where "team_idnumber" = #{id};
|
update "ynrealname"."bm_sub_team" set team_Idnumber = #{idNumber} where team_Idnumber = #{id};
|
||||||
update "ynrealname"."bm_team_user_relation" set "id_number" = #{idNumber} where "id_number" = #{id};
|
update "ynrealname"."bm_team_user_relation" set "id_number" = #{idNumber} where "id_number" = #{id};
|
||||||
update "ynrealname"."fc_face_contrast" set "id_number" = #{idNumber} where "id_number" = #{id}
|
update "ynrealname"."fc_face_contrast" set ID_NUMBER = #{idNumber} where ID_NUMBER = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deletePerson">
|
<delete id="deletePerson">
|
||||||
|
|
@ -121,39 +121,39 @@
|
||||||
|
|
||||||
<select id="selectBasePersonList" resultType="com.bonus.bmw.person.entity.BasePersonBean">
|
<select id="selectBasePersonList" resultType="com.bonus.bmw.person.entity.BasePersonBean">
|
||||||
select bw."name",bw."id_number" as idNumber,bw."sex",td."value" as postName,
|
select bw."name",bw."id_number" as idNumber,bw."sex",td."value" as postName,
|
||||||
bw."phone",bw."worker_skill" as workerSkill,face."photo_path" as facePhoto,
|
bw."phone",bw."worker_skill" as workerSkill,face.PHOTO_PATH as facePhoto,
|
||||||
aoto."photo_path" as aotoPhoto,bst."id" as teamId,bw."ein_status" as exitStatus
|
aoto.PHOTO_PATH as aotoPhoto,bst.id as teamId,bw."ein_status" as exitStatus
|
||||||
from "ynrealname"."bm_worker" bw
|
from "ynrealname"."bm_worker" bw
|
||||||
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst."team_idnumber" = bw."id_number" and bst."is_active" = '1'
|
LEFT JOIN "ynrealname"."bm_sub_team" bst ON bst.team_Idnumber = bw."id_number" and bst.is_active = '1'
|
||||||
left join "ynrealname"."bm_worker_photo" face on face."id_number" = bw."id_number"
|
left join "ynrealname"."bm_worker_photo" face on face.ID_NUMBER = bw."id_number"
|
||||||
and face."photo_type" = 3 and face."is_active" = 1
|
and face.PHOTO_TYPE = 3 and face.IS_ACTIVE = 1
|
||||||
left join "ynrealname"."bm_worker_photo" aoto on aoto."id_number" = bw."id_number"
|
left join "ynrealname"."bm_worker_photo" aoto on aoto.ID_NUMBER = bw."id_number"
|
||||||
and aoto."photo_type" = 5 and aoto."is_active" = 1
|
and aoto.PHOTO_TYPE = 5 and aoto.IS_ACTIVE = 1
|
||||||
left join "ynrealname"."t_dict" td on td."id" = bw."post_id" and td."is_active" = '1'
|
left join "ynrealname"."t_dict" td on td.id = bw."post_id" and td.is_active = '1'
|
||||||
where bw."is_active" = 1
|
where bw.IS_ACTIVE = 1
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and (
|
and (
|
||||||
bw."id_number" like '%' || #{params.keyWord} || '%'
|
bw."id_number" like concat('%',#{params.keyWord},'%')
|
||||||
or bw."name" like '%' || #{params.keyWord} || '%'
|
or bw."name" like concat('%',#{params.keyWord},'%')
|
||||||
or td."value" like '%' || #{params.keyWord} || '%'
|
or td."value" like concat('%',#{params.keyWord},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
GROUP BY bw."id_number", bw."name", bw."sex", td."value", bw."phone", bw."worker_skill", face."photo_path", aoto."photo_path", bst."id", bw."ein_status"
|
GROUP BY bw."id_number", bw."name", bw."sex", td."value", bw."phone", bw."worker_skill", face.PHOTO_PATH, aoto.PHOTO_PATH, bst.id, bw."ein_status"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBasePersonCount" resultType="java.lang.Integer">
|
<select id="selectBasePersonCount" resultType="java.lang.Integer">
|
||||||
select count(bw."id_number") from "ynrealname"."bm_worker" bw
|
select count(bw.id_number) from "ynrealname"."bm_worker" bw
|
||||||
left join "ynrealname"."bm_worker_photo" face on face."id_number" = bw."id_number"
|
left join "ynrealname"."bm_worker_photo" face on face.ID_NUMBER = bw.id_number
|
||||||
and face."photo_type" = 3 and face."is_active" = 1
|
and face.PHOTO_TYPE = 3 and face.IS_ACTIVE = 1
|
||||||
left join "ynrealname"."bm_worker_photo" aoto on aoto."id_number" = bw."id_number"
|
left join "ynrealname"."bm_worker_photo" aoto on aoto.ID_NUMBER = bw.id_number
|
||||||
and aoto."photo_type" = 4 and aoto."is_active" = 1
|
and aoto.PHOTO_TYPE = 4 and aoto.IS_ACTIVE = 1
|
||||||
left join "ynrealname"."t_dict" td on td."id" = bw."post_id" and td."is_active" = '1'
|
left join "ynrealname"."t_dict" td on td.id = bw.post_id and td.is_active = '1'
|
||||||
where bw."is_active" = 1
|
where bw.IS_ACTIVE = 1
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and (
|
and (
|
||||||
bw."id_number" like '%' || #{params.keyWord} || '%'
|
bw.id_number like concat('%',#{params.keyWord},'%')
|
||||||
or bw."name" like '%' || #{params.keyWord} || '%'
|
or bw.name like concat('%',#{params.keyWord},'%')
|
||||||
or td."value" like '%' || #{params.keyWord} || '%'
|
or td."value" like concat('%',#{params.keyWord},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -175,8 +175,8 @@
|
||||||
bw."expiry_date" AS expiryDate,
|
bw."expiry_date" AS expiryDate,
|
||||||
bw."post_id" AS postId,
|
bw."post_id" AS postId,
|
||||||
bw."phone",
|
bw."phone",
|
||||||
bwp."bank_name" AS bankName,
|
bwp.BANK_NAME AS bankName,
|
||||||
bwp."bank_card" AS bankCard,
|
bwp.BANK_CARD AS bankCard,
|
||||||
bw."person_type" AS personType,
|
bw."person_type" AS personType,
|
||||||
bw."worker_skill" AS workerSkill,
|
bw."worker_skill" AS workerSkill,
|
||||||
bw."urgent_person" AS urgentPerson,
|
bw."urgent_person" AS urgentPerson,
|
||||||
|
|
@ -188,11 +188,11 @@
|
||||||
bw."address_phone" as addressPhone
|
bw."address_phone" as addressPhone
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_worker" bw
|
"ynrealname"."bm_worker" bw
|
||||||
LEFT JOIN "ynrealname"."bm_worker_bank" bwp ON bw."id_number" = bwp."id_number"
|
LEFT JOIN "ynrealname"."bm_worker_bank" bwp ON bw.id_number = bwp.ID_NUMBER
|
||||||
AND bwp."is_active" = '1'
|
AND bwp.is_active = '1'
|
||||||
WHERE
|
WHERE
|
||||||
bw."is_active" = '1'
|
bw.is_active = '1'
|
||||||
AND bw."id_number" = #{idNumber}
|
AND bw.id_number = #{idNumber}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getBlackPerson" resultType="java.lang.String">
|
<select id="getBlackPerson" resultType="java.lang.String">
|
||||||
|
|
@ -208,22 +208,22 @@
|
||||||
bw."address",
|
bw."address",
|
||||||
bw."phone",
|
bw."phone",
|
||||||
bp."name" AS proName,
|
bp."name" AS proName,
|
||||||
po."name" AS orgName
|
po.NAME AS orgName
|
||||||
FROM
|
FROM
|
||||||
"ynrealname"."bm_worker" bw
|
"ynrealname"."bm_worker" bw
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT t."id_number", t."project_id" FROM (
|
SELECT t.id_number, t.project_id FROM (
|
||||||
SELECT "id_number", "project_id", ROW_NUMBER() OVER (PARTITION BY "id_number" ORDER BY "ein_time" DESC) AS rn
|
SELECT id_number, project_id, ROW_NUMBER() OVER (PARTITION BY id_number ORDER BY ein_time DESC) AS rn
|
||||||
FROM "ynrealname"."bm_worker_ein_history"
|
FROM "ynrealname"."bm_worker_ein_history"
|
||||||
) t WHERE t.rn = 1
|
) t WHERE t.rn = 1
|
||||||
) bweh ON bw."id_number" = bweh."id_number"
|
) bweh ON bw.id_number = bweh.id_number
|
||||||
LEFT JOIN "ynrealname"."bm_project" bp ON bweh."project_id" = bp."id"
|
LEFT JOIN "ynrealname"."bm_project" bp ON bweh.project_id = bp.id
|
||||||
LEFT JOIN "ynrealname"."pm_organization" po ON bp."two_com_id" = po."id"
|
LEFT JOIN "ynrealname"."pm_organization" po ON bp.two_com_id = po.id
|
||||||
where bw."is_active" = 1
|
where bw.IS_ACTIVE = 1
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and (
|
and (
|
||||||
bw."id_number" like '%' || #{params.keyWord} || '%'
|
bw."id_number" like concat('%',#{params.keyWord},'%')
|
||||||
or bw."name" like '%' || #{params.keyWord} || '%'
|
or bw."name" like concat('%',#{params.keyWord},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
</if>
|
</if>
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and (
|
and (
|
||||||
bs."sub_name" like concat('%', #{params.keyWord}, '%') or
|
bs."sub_name" like '%' || #{params.keyWord} || '%' or
|
||||||
bw."name" like concat('%', #{params.keyWord}, '%')
|
bw."name" like '%' || #{params.keyWord} || '%'
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id" AND btur."is_active" = '1'
|
LEFT JOIN "ynrealname"."bm_team_user_relation" btur ON btur."team_id" = bst."id" AND btur."is_active" = '1'
|
||||||
LEFT JOIN "ynrealname"."bm_worker" bw1 ON bw1."id_number" = btur."id_number" AND bw1."is_active" = '1' AND bw1."ein_status" = '1'
|
LEFT JOIN "ynrealname"."bm_worker" bw1 ON bw1."id_number" = btur."id_number" AND bw1."is_active" = '1' AND bw1."ein_status" = '1'
|
||||||
<include refid="where" />
|
<include refid="where" />
|
||||||
GROUP BY bst."id"
|
GROUP BY bst."id", bst."team_name", bs."sub_name", bw."name", bst."team_Idnumber", bw."phone"
|
||||||
order by bst."id" desc
|
order by bst."id" desc
|
||||||
<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} ROWS FETCH NEXT #{limit} ROWS ONLY
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
and (bs."id" = #{params.subId} or bs."id" is null)
|
and (bs."id" = #{params.subId} or bs."id" is null)
|
||||||
</if>
|
</if>
|
||||||
<if test="params.keyWord != null and params.keyWord != ''">
|
<if test="params.keyWord != null and params.keyWord != ''">
|
||||||
and bw."name" like concat('%',#{params.keyWord},'%')
|
and bw."name" like '%' || #{params.keyWord} || '%'
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.bonus.bmw.team.entity.TeamBean">
|
<select id="getById" resultType="com.bonus.bmw.team.entity.TeamBean">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue