qa-prevention-gwj/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml

350 lines
9.2 KiB
XML
Raw Normal View History

2023-12-18 18:54:50 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper">
<!--表名 -->
<sql id="tableName">
XGF_USER_DETAILS
</sql>
<!-- 字段 -->
<sql id="Field">
2023-12-18 19:58:52 +08:00
f.XGF_USER_DETAILS_ID,
2023-12-18 18:54:50 +08:00
f.XGF_USER_ID,
f.XGF_USER_NAME,
f.BELONG_TO_CORP,
f.BELONG_TO_CORP_NAME,
f.PHONE,
2023-12-21 19:55:08 +08:00
f.CREATE_TIME,
2023-12-18 18:54:50 +08:00
f.DEPART_STATE,
2023-12-23 10:27:04 +08:00
f.IS_DELETE,
2023-12-18 18:54:50 +08:00
f.AGE,
f.HKLOCAL,
f.ADDRESS,
f.DEGREE_OF_EDUCATION,
f.DEGREE_OF_EDUCATION_NAME,
f.CORP_START_DATE,
f.POST_ID,
f.POST_NAME,
f.WORK_SIGN,
f.JOINED_DATE,
f.WORK_DATE,
f.PHOTO,
f.DATE_OF_BIRTH,
f.ISPAY,
f.ISPAY_NUMBER,
f.IS_SAFETY_TELL,
f.IS_SAFETY_TIME,
f.IS_INJURIES_PAY,
f.IS_SIGN_LABOR,
f.SEX,
f.ENTRY_DATE,
f.PERSON_WORK_TYPE,
f.PERSON_WORK_TYPE_NAME,
f.NATIONALITY,
f.NATIONALITY_NAME,
f.POLITICAL_TIME,
f.POLITICAL_STATUS,
f.POLITICAL_STATUS_NAME,
f.IS_INJURIES_PAY_TIME,
f.IS_LEVEL_THREE,
f.IS_BODY_ADAPT,
f.IS_SPECIAL_JOB,
2023-12-19 20:03:25 +08:00
f.CORPINFO_ID,
2023-12-20 19:51:15 +08:00
f.MANAGER_DEPARTMENT_ID,
2023-12-22 15:49:12 +08:00
f.MANAGER_DEPARTMENT_NAME,
f.COMPETENT_DEPARTMENT_ID,
f.COMPETENT_DEPARTMENT_NAME,
f.MAIN_DEPARTMENT_ID,
f.MAIN_DEPARTMENT_NAME,
2023-12-20 19:51:15 +08:00
f.CARD_ID,
f.DEPARTMENT_ID,
f.DEPARTMENT_NAME,
f.IS_BF,
f.IS_SOCIAL,
f.SOCIAL_NUMBER,
2024-02-04 11:03:13 +08:00
f.zzName,
f.ANNEX,
f.ATTORNEY,
f.COMMITMENT_LETTER
2023-12-18 18:54:50 +08:00
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
2023-12-18 19:58:52 +08:00
XGF_USER_DETAILS_ID,
2023-12-18 18:54:50 +08:00
XGF_USER_ID,
XGF_USER_NAME,
BELONG_TO_CORP,
BELONG_TO_CORP_NAME,
PHONE,
2023-12-21 19:55:08 +08:00
CREATE_TIME,
2023-12-18 18:54:50 +08:00
DEPART_STATE,
2023-12-23 10:27:04 +08:00
IS_DELETE,
2023-12-18 18:54:50 +08:00
AGE,
HKLOCAL,
ADDRESS,
DEGREE_OF_EDUCATION,
DEGREE_OF_EDUCATION_NAME,
CORP_START_DATE,
POST_ID,
POST_NAME,
WORK_SIGN,
JOINED_DATE,
WORK_DATE,
PHOTO,
DATE_OF_BIRTH,
ISPAY,
ISPAY_NUMBER,
IS_SAFETY_TELL,
IS_SAFETY_TIME,
IS_INJURIES_PAY,
IS_SIGN_LABOR,
SEX,
ENTRY_DATE,
PERSON_WORK_TYPE,
PERSON_WORK_TYPE_NAME,
NATIONALITY,
NATIONALITY_NAME,
POLITICAL_TIME,
POLITICAL_STATUS,
POLITICAL_STATUS_NAME,
IS_INJURIES_PAY_TIME,
IS_LEVEL_THREE,
IS_BODY_ADAPT,
IS_SPECIAL_JOB,
2023-12-19 20:03:25 +08:00
CORPINFO_ID,
MANAGER_DEPARTMENT_ID,
2023-12-20 19:51:15 +08:00
MANAGER_DEPARTMENT_NAME,
2023-12-22 15:49:12 +08:00
COMPETENT_DEPARTMENT_ID,
COMPETENT_DEPARTMENT_NAME,
MAIN_DEPARTMENT_ID,
MAIN_DEPARTMENT_NAME,
2023-12-20 19:51:15 +08:00
CARD_ID,
DEPARTMENT_ID,
DEPARTMENT_NAME,
IS_BF,
IS_SOCIAL,
SOCIAL_NUMBER,
2024-02-04 11:03:13 +08:00
zzName,
ANNEX,
ATTORNEY,
COMMITMENT_LETTER
2023-12-18 18:54:50 +08:00
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
2023-12-18 19:58:52 +08:00
#{XGF_USER_DETAILS_ID},
2023-12-18 18:54:50 +08:00
#{XGF_USER_ID},
#{XGF_USER_NAME},
#{BELONG_TO_CORP},
#{BELONG_TO_CORP_NAME},
#{PHONE},
2023-12-21 19:55:08 +08:00
#{CREATE_TIME},
2023-12-18 18:54:50 +08:00
#{DEPART_STATE},
2023-12-23 10:27:04 +08:00
#{IS_DELETE},
2023-12-18 18:54:50 +08:00
#{AGE},
#{HKLOCAL},
#{ADDRESS},
#{DEGREE_OF_EDUCATION},
#{DEGREE_OF_EDUCATION_NAME},
#{CORP_START_DATE},
#{POST_ID},
#{POST_NAME},
#{WORK_SIGN},
#{JOINED_DATE},
#{WORK_DATE},
#{PHOTO},
#{DATE_OF_BIRTH},
#{ISPAY},
#{ISPAY_NUMBER},
#{IS_SAFETY_TELL},
#{IS_SAFETY_TIME},
#{IS_INJURIES_PAY},
#{IS_SIGN_LABOR},
#{SEX},
#{ENTRY_DATE},
#{PERSON_WORK_TYPE},
#{PERSON_WORK_TYPE_NAME},
#{NATIONALITY},
#{NATIONALITY_NAME},
#{POLITICAL_TIME},
#{POLITICAL_STATUS},
#{POLITICAL_STATUS_NAME},
#{IS_INJURIES_PAY_TIME},
#{IS_LEVEL_THREE},
#{IS_BODY_ADAPT},
#{IS_SPECIAL_JOB},
2023-12-19 20:03:25 +08:00
#{CORPINFO_ID},
#{MANAGER_DEPARTMENT_ID},
2023-12-20 19:51:15 +08:00
#{MANAGER_DEPARTMENT_NAME},
2023-12-22 15:49:12 +08:00
#{COMPETENT_DEPARTMENT_ID},
#{COMPETENT_DEPARTMENT_NAME},
#{MAIN_DEPARTMENT_ID},
#{MAIN_DEPARTMENT_NAME},
2023-12-20 19:51:15 +08:00
#{CARD_ID},
#{DEPARTMENT_ID},
#{DEPARTMENT_NAME},
#{IS_BF},
#{IS_SOCIAL},
#{SOCIAL_NUMBER},
2024-02-04 11:03:13 +08:00
#{zzName},
#{ANNEX},
#{ATTORNEY},
#{COMMITMENT_LETTER}
2023-12-18 18:54:50 +08:00
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
2023-12-23 10:27:04 +08:00
IS_DELETE = '1'
2023-12-18 18:54:50 +08:00
where
XGF_USER_ID = #{XGF_USER_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
2023-12-18 19:58:52 +08:00
XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID},
2023-12-18 18:54:50 +08:00
XGF_USER_ID = #{XGF_USER_ID},
XGF_USER_NAME = #{XGF_USER_NAME},
BELONG_TO_CORP = #{BELONG_TO_CORP},
BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME},
PHONE = #{PHONE},
2023-12-21 19:55:08 +08:00
CREATE_TIME = #{CREATE_TIME},
2023-12-18 18:54:50 +08:00
DEPART_STATE = #{DEPART_STATE},
2023-12-23 10:27:04 +08:00
IS_DELETE = #{IS_DELETE},
2023-12-18 18:54:50 +08:00
AGE = #{AGE},
HKLOCAL = #{HKLOCAL},
ADDRESS = #{ADDRESS},
2023-12-18 19:58:52 +08:00
DEGREE_OF_EDUCATION = #{DEGREE_OF_EDUCATION},
2023-12-18 18:54:50 +08:00
DEGREE_OF_EDUCATION_NAME = #{DEGREE_OF_EDUCATION_NAME},
CORP_START_DATE = #{CORP_START_DATE},
POST_ID = #{POST_ID},
POST_NAME = #{POST_NAME},
WORK_SIGN = #{WORK_SIGN},
JOINED_DATE = #{JOINED_DATE},
WORK_DATE = #{WORK_DATE},
PHOTO = #{PHOTO},
DATE_OF_BIRTH = #{DATE_OF_BIRTH},
ISPAY = #{ISPAY},
ISPAY_NUMBER = #{ISPAY_NUMBER},
IS_SAFETY_TELL = #{IS_SAFETY_TELL},
IS_SAFETY_TIME = #{IS_SAFETY_TIME},
IS_INJURIES_PAY = #{IS_INJURIES_PAY},
IS_SIGN_LABOR = #{IS_SIGN_LABOR},
SEX = #{SEX},
ENTRY_DATE = #{ENTRY_DATE},
PERSON_WORK_TYPE = #{PERSON_WORK_TYPE},
PERSON_WORK_TYPE_NAME = #{PERSON_WORK_TYPE_NAME},
NATIONALITY = #{NATIONALITY},
NATIONALITY_NAME = #{NATIONALITY_NAME},
POLITICAL_TIME = #{POLITICAL_TIME},
POLITICAL_STATUS = #{POLITICAL_STATUS},
POLITICAL_STATUS_NAME = #{POLITICAL_STATUS_NAME},
IS_INJURIES_PAY_TIME = #{IS_INJURIES_PAY_TIME},
IS_LEVEL_THREE = #{IS_LEVEL_THREE},
IS_BODY_ADAPT = #{IS_BODY_ADAPT},
IS_SPECIAL_JOB = #{IS_SPECIAL_JOB},
2023-12-19 20:03:25 +08:00
CORPINFO_ID = #{CORPINFO_ID},
MANAGER_DEPARTMENT_ID = #{MANAGER_DEPARTMENT_ID},
2023-12-20 19:51:15 +08:00
MANAGER_DEPARTMENT_NAME = #{MANAGER_DEPARTMENT_NAME},
2023-12-22 15:49:12 +08:00
COMPETENT_DEPARTMENT_ID = #{COMPETENT_DEPARTMENT_ID},
COMPETENT_DEPARTMENT_NAME = #{COMPETENT_DEPARTMENT_NAME},
MAIN_DEPARTMENT_ID = #{MAIN_DEPARTMENT_ID},
MAIN_DEPARTMENT_NAME = #{MAIN_DEPARTMENT_NAME},
2023-12-20 19:51:15 +08:00
CARD_ID = #{CARD_ID},
DEPARTMENT_ID = #{DEPARTMENT_ID},
DEPARTMENT_NAME = #{DEPARTMENT_NAME},
IS_BF = #{IS_BF},
IS_SOCIAL = #{IS_SOCIAL},
SOCIAL_NUMBER = #{SOCIAL_NUMBER},
2024-02-04 11:03:13 +08:00
zzName = #{zzName},
ANNEX = #{ANNEX},
ATTORNEY = #{ATTORNEY},
COMMITMENT_LETTER = #{COMMITMENT_LETTER}
2023-12-18 18:54:50 +08:00
where
2023-12-18 19:58:52 +08:00
XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID}
2023-12-18 18:54:50 +08:00
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where
f.XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID}
2023-12-18 18:54:50 +08:00
</select>
<!-- 列表 -->
<select id="listPage" parameterType="page" resultType="pd">
select
*
from
<include refid="tableName"></include>
f
2023-12-23 10:27:04 +08:00
where f.IS_DELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
2023-12-18 18:54:50 +08:00
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
</if>
ORDER BY f.CREATED_TIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
*
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
2023-12-23 10:27:04 +08:00
where f.IS_DELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
2023-12-18 18:54:50 +08:00
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
2023-12-23 10:27:04 +08:00
IS_DELETE = '1',
2023-12-18 18:54:50 +08:00
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
XFG_USER_DETAILS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据多选ID查询数据) -->
<select id="listByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
2023-12-23 10:27:04 +08:00
where f.IS_DELETE = '0'
2023-12-18 18:54:50 +08:00
and XFG_USER_DETAILS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>