<?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="cn.com.basic.security.entity.Se_Personnel" >
|
|
<resultMap id="BaseResultMap" type="cn.com.basic.security.entity.Se_Personnel" >
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
<result column="org_id" property="orgId" jdbcType="VARCHAR" />
|
<result column="nation" property="nation" jdbcType="VARCHAR" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="english_name" property="englishName" jdbcType="VARCHAR" />
|
<result column="sex" property="sex" jdbcType="TINYINT" />
|
<result column="age" property="age" jdbcType="TINYINT" />
|
<result column="blood_type" property="bloodType" jdbcType="VARCHAR" />
|
<result column="birth" property="birth" jdbcType="DATE" />
|
<result column="id_number" property="idNumber" jdbcType="VARCHAR" />
|
<result column="political_landscape" property="politicalLandscape" jdbcType="VARCHAR" />
|
<result column="party_time" property="partyTime" jdbcType="TIMESTAMP" />
|
<result column="head_pic" property="headPic" jdbcType="VARCHAR" />
|
<result column="place_origin" property="placeOrigin" jdbcType="VARCHAR" />
|
<result column="marriage" property="marriage" jdbcType="VARCHAR" />
|
<result column="status" property="status" jdbcType="TINYINT" />
|
<result column="home_address" property="homeAddress" jdbcType="VARCHAR" />
|
<result column="health" property="health" jdbcType="VARCHAR" />
|
<result column="registered_residence_type" property="registeredResidenceType" jdbcType="VARCHAR" />
|
<result column="province" property="province" jdbcType="VARCHAR" />
|
<result column="city" property="city" jdbcType="VARCHAR" />
|
<result column="area" property="area" jdbcType="VARCHAR" />
|
<result column="address" property="address" jdbcType="VARCHAR" />
|
<result column="post" property="post" jdbcType="VARCHAR" />
|
<result column="department" property="department" jdbcType="VARCHAR" />
|
<result column="contact_phone" property="contactPhone" jdbcType="VARCHAR" />
|
<result column="job_number" property="jobNumber" jdbcType="VARCHAR" />
|
<result column="job_state" property="jobState" jdbcType="TINYINT" />
|
<result column="contract_type" property="contractType" jdbcType="VARCHAR" />
|
<result column="registered_capital" property="registeredCapital" jdbcType="VARCHAR" />
|
<result column="company_security_number" property="companySecurityNumber" jdbcType="VARCHAR" />
|
<result column="assignment_company_name" property="assignmentCompanyName" jdbcType="VARCHAR" />
|
<result column="nature_company" property="natureCompany" jdbcType="VARCHAR" />
|
<result column="graduate_school" property="graduateSchool" jdbcType="VARCHAR" />
|
<result column="education" property="education" jdbcType="VARCHAR" />
|
<result column="is_valid" property="isValid" jdbcType="TINYINT" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
|
</resultMap>
|
|
<sql id="Base_Column_List" >
|
id, org_id, nation, name, english_name, sex, age, blood_type, birth, id_number,
|
political_landscape, party_time, head_pic, place_origin, marriage, status, home_address,
|
health, registered_residence_type, province, city, area, address, post, contact_phone,
|
job_number, job_state, contract_type, registered_capital, company_security_number,
|
assignment_company_name, nature_company, graduate_school, education, is_valid, update_time,
|
update_user_id,department
|
</sql>
|
|
<sql id="Base_Where_Clause">
|
<where>
|
<trim prefixOverrides="and">
|
<if test="id != null"> and ID = #{id}</if>
|
<if test="orgId != null" >
|
and org_id = #{orgId,jdbcType=VARCHAR}
|
</if>
|
<if test="sex != null" >
|
and sex = #{sex,jdbcType=VARCHAR}
|
</if>
|
<if test="name != null" >
|
and name like CONCAT("%",#{name},"%")
|
</if>
|
<if test="status != null" >
|
and status = #{status,jdbcType=TINYINT}
|
</if>
|
<if test="isValid != null" >
|
and is_valid = #{isValid,jdbcType=TINYINT}
|
</if>
|
<if test="updateTime != null" >
|
and update_time = #{updateTime,jdbcType=TIMESTAMP}
|
</if>
|
<if test="updateUserId != null" >
|
and update_user_id = #{updateUserId,jdbcType=VARCHAR}
|
</if>
|
<!-- 模糊查询 -->
|
<!--<if test="name != null">and name like CONCAT("%",#{name},"%")</if>-->
|
</trim>
|
</where>
|
<if test="sorting != null">order by ${sorting}</if>
|
<if test="offset != null and limit != null">
|
limit #{offset}, #{limit}
|
</if>
|
</sql>
|
|
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
select
|
p.id, p.org_id orgId, p.nation, p.name, p.english_name englishName, p.sex, p.age, p.blood_type bloodType, p.birth, p.id_number idNumber,
|
p.political_landscape politicalLandscape, p.party_time partyTime, p.head_pic headPic, p.place_origin placeOrigin, p.marriage, p.status, p.home_address homeAddress,
|
p.health, p.registered_residence_type registeredResidenceType, p.province, p.city, p.area, p.address, p.post,p.department, p.contact_phone contactPhone,
|
p.job_number jobNumber, p.job_state jobState, p.contract_type contractType, p.registered_capital registeredCapital, p.company_security_number companySecurityNumber,
|
p.assignment_company_name assignmentCompanyName, p.nature_company natureCompany, p.graduate_school graduateSchool, p.education, p.is_valid isValid, p.update_time updateTime,
|
o.name orgName
|
|
|
from se_personnel p join t_sys_organization o on p.org_id = o.id
|
where p.id = #{id,jdbcType=VARCHAR}
|
|
</select>
|
|
<!-- 查询总数 -->
|
<select id="selectCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
select count(ID)
|
from se_personnel
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
<select id="select" resultMap="BaseResultMap" parameterType="java.util.Map" >
|
select
|
<include refid="Base_Column_List" />
|
from se_personnel
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
<select id="selectByOrgId" resultType="cn.com.basic.security.dto.PersonnelDto" parameterType="java.util.Map" >
|
select
|
id,name
|
from se_personnel
|
<include refid="Base_Where_Clause" />
|
</select>
|
|
|
|
<delete id="delete" parameterType="java.lang.String" >
|
delete from se_personnel
|
where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
|
<insert id="insert" parameterType="cn.com.basic.security.entity.Se_Personnel" >
|
insert into se_personnel (id, org_id, nation,
|
name, english_name, sex,
|
age, blood_type, birth,
|
id_number, political_landscape, party_time,
|
head_pic, place_origin, marriage,
|
status, home_address, health,
|
registered_residence_type, province, city,
|
area, address, post,department,
|
contact_phone, job_number, job_state,
|
contract_type, registered_capital, company_security_number,
|
assignment_company_name, nature_company, graduate_school,
|
education, is_valid, update_time,
|
update_user_id)
|
values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, #{nation,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR}, #{englishName,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT},
|
#{age,jdbcType=TINYINT}, #{bloodType,jdbcType=VARCHAR}, #{birth,jdbcType=DATE},
|
#{idNumber,jdbcType=VARCHAR}, #{politicalLandscape,jdbcType=VARCHAR}, #{partyTime,jdbcType=TIMESTAMP},
|
#{headPic,jdbcType=VARCHAR}, #{placeOrigin,jdbcType=VARCHAR}, #{marriage,jdbcType=VARCHAR},
|
#{status,jdbcType=TINYINT}, #{homeAddress,jdbcType=VARCHAR}, #{health,jdbcType=VARCHAR},
|
#{registeredResidenceType,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR},
|
#{area,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{post,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
|
#{contactPhone,jdbcType=VARCHAR}, #{jobNumber,jdbcType=VARCHAR}, #{jobState,jdbcType=TINYINT},
|
#{contractType,jdbcType=VARCHAR}, #{registeredCapital,jdbcType=VARCHAR}, #{companySecurityNumber,jdbcType=VARCHAR},
|
#{assignmentCompanyName,jdbcType=VARCHAR}, #{natureCompany,jdbcType=VARCHAR}, #{graduateSchool,jdbcType=VARCHAR},
|
#{education,jdbcType=VARCHAR}, #{isValid,jdbcType=TINYINT}, #{updateTime,jdbcType=TIMESTAMP},
|
#{updateUserId,jdbcType=VARCHAR})
|
</insert>
|
|
<insert id="insertSelective" parameterType="cn.com.basic.security.entity.Se_Personnel" >
|
insert into se_personnel
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="orgId != null" >
|
org_id,
|
</if>
|
<if test="nation != null" >
|
nation,
|
</if>
|
<if test="name != null" >
|
name,
|
</if>
|
<if test="englishName != null" >
|
english_name,
|
</if>
|
<if test="sex != null" >
|
sex,
|
</if>
|
<if test="age != null" >
|
age,
|
</if>
|
<if test="bloodType != null" >
|
blood_type,
|
</if>
|
<if test="birth != null" >
|
birth,
|
</if>
|
<if test="idNumber != null" >
|
id_number,
|
</if>
|
<if test="politicalLandscape != null" >
|
political_landscape,
|
</if>
|
<if test="partyTime != null" >
|
party_time,
|
</if>
|
<if test="headPic != null" >
|
head_pic,
|
</if>
|
<if test="placeOrigin != null" >
|
place_origin,
|
</if>
|
<if test="marriage != null" >
|
marriage,
|
</if>
|
<if test="status != null" >
|
status,
|
</if>
|
<if test="homeAddress != null" >
|
home_address,
|
</if>
|
<if test="health != null" >
|
health,
|
</if>
|
<if test="registeredResidenceType != null" >
|
registered_residence_type,
|
</if>
|
<if test="province != null" >
|
province,
|
</if>
|
<if test="city != null" >
|
city,
|
</if>
|
<if test="area != null" >
|
area,
|
</if>
|
<if test="address != null" >
|
address,
|
</if>
|
<if test="post != null" >
|
post,
|
</if>
|
<if test="department != null" >
|
department,
|
</if>
|
<if test="contactPhone != null" >
|
contact_phone,
|
</if>
|
<if test="jobNumber != null" >
|
job_number,
|
</if>
|
<if test="jobState != null" >
|
job_state,
|
</if>
|
<if test="contractType != null" >
|
contract_type,
|
</if>
|
<if test="registeredCapital != null" >
|
registered_capital,
|
</if>
|
<if test="companySecurityNumber != null" >
|
company_security_number,
|
</if>
|
<if test="assignmentCompanyName != null" >
|
assignment_company_name,
|
</if>
|
<if test="natureCompany != null" >
|
nature_company,
|
</if>
|
<if test="graduateSchool != null" >
|
graduate_school,
|
</if>
|
<if test="education != null" >
|
education,
|
</if>
|
<if test="isValid != null" >
|
is_valid,
|
</if>
|
<if test="updateTime != null" >
|
update_time,
|
</if>
|
<if test="updateUserId != null" >
|
update_user_id,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="orgId != null" >
|
#{orgId,jdbcType=VARCHAR},
|
</if>
|
<if test="nation != null" >
|
#{nation,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="englishName != null" >
|
#{englishName,jdbcType=VARCHAR},
|
</if>
|
<if test="sex != null" >
|
#{sex,jdbcType=TINYINT},
|
</if>
|
<if test="age != null" >
|
#{age,jdbcType=TINYINT},
|
</if>
|
<if test="bloodType != null" >
|
#{bloodType,jdbcType=VARCHAR},
|
</if>
|
<if test="birth != null" >
|
#{birth,jdbcType=DATE},
|
</if>
|
<if test="idNumber != null" >
|
#{idNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="politicalLandscape != null" >
|
#{politicalLandscape,jdbcType=VARCHAR},
|
</if>
|
<if test="partyTime != null" >
|
#{partyTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="headPic != null" >
|
#{headPic,jdbcType=VARCHAR},
|
</if>
|
<if test="placeOrigin != null" >
|
#{placeOrigin,jdbcType=VARCHAR},
|
</if>
|
<if test="marriage != null" >
|
#{marriage,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
#{status,jdbcType=TINYINT},
|
</if>
|
<if test="homeAddress != null" >
|
#{homeAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="health != null" >
|
#{health,jdbcType=VARCHAR},
|
</if>
|
<if test="registeredResidenceType != null" >
|
#{registeredResidenceType,jdbcType=VARCHAR},
|
</if>
|
<if test="province != null" >
|
#{province,jdbcType=VARCHAR},
|
</if>
|
<if test="city != null" >
|
#{city,jdbcType=VARCHAR},
|
</if>
|
<if test="area != null" >
|
#{area,jdbcType=VARCHAR},
|
</if>
|
<if test="address != null" >
|
#{address,jdbcType=VARCHAR},
|
</if>
|
<if test="post != null" >
|
#{post,jdbcType=VARCHAR},
|
</if>
|
<if test="department != null" >
|
#{department,jdbcType=VARCHAR},
|
</if>
|
<if test="contactPhone != null" >
|
#{contactPhone,jdbcType=VARCHAR},
|
</if>
|
<if test="jobNumber != null" >
|
#{jobNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="jobState != null" >
|
#{jobState,jdbcType=TINYINT},
|
</if>
|
<if test="contractType != null" >
|
#{contractType,jdbcType=VARCHAR},
|
</if>
|
<if test="registeredCapital != null" >
|
#{registeredCapital,jdbcType=VARCHAR},
|
</if>
|
<if test="companySecurityNumber != null" >
|
#{companySecurityNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="assignmentCompanyName != null" >
|
#{assignmentCompanyName,jdbcType=VARCHAR},
|
</if>
|
<if test="natureCompany != null" >
|
#{natureCompany,jdbcType=VARCHAR},
|
</if>
|
<if test="graduateSchool != null" >
|
#{graduateSchool,jdbcType=VARCHAR},
|
</if>
|
<if test="education != null" >
|
#{education,jdbcType=VARCHAR},
|
</if>
|
<if test="isValid != null" >
|
#{isValid,jdbcType=TINYINT},
|
</if>
|
<if test="updateTime != null" >
|
#{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUserId != null" >
|
#{updateUserId,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
|
<update id="updateByIdSelective" parameterType="cn.com.basic.security.entity.Se_Personnel" >
|
update se_personnel
|
<set >
|
<if test="orgId != null" >
|
org_id = #{orgId,jdbcType=VARCHAR},
|
</if>
|
<if test="nation != null" >
|
nation = #{nation,jdbcType=VARCHAR},
|
</if>
|
<if test="name != null" >
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="englishName != null" >
|
english_name = #{englishName,jdbcType=VARCHAR},
|
</if>
|
<if test="sex != null" >
|
sex = #{sex,jdbcType=TINYINT},
|
</if>
|
<if test="age != null" >
|
age = #{age,jdbcType=TINYINT},
|
</if>
|
<if test="bloodType != null" >
|
blood_type = #{bloodType,jdbcType=VARCHAR},
|
</if>
|
<if test="birth != null" >
|
birth = #{birth,jdbcType=DATE},
|
</if>
|
<if test="idNumber != null" >
|
id_number = #{idNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="politicalLandscape != null" >
|
political_landscape = #{politicalLandscape,jdbcType=VARCHAR},
|
</if>
|
<if test="partyTime != null" >
|
party_time = #{partyTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="headPic != null" >
|
head_pic = #{headPic,jdbcType=VARCHAR},
|
</if>
|
<if test="placeOrigin != null" >
|
place_origin = #{placeOrigin,jdbcType=VARCHAR},
|
</if>
|
<if test="marriage != null" >
|
marriage = #{marriage,jdbcType=VARCHAR},
|
</if>
|
<if test="status != null" >
|
status = #{status,jdbcType=TINYINT},
|
</if>
|
<if test="homeAddress != null" >
|
home_address = #{homeAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="health != null" >
|
health = #{health,jdbcType=VARCHAR},
|
</if>
|
<if test="registeredResidenceType != null" >
|
registered_residence_type = #{registeredResidenceType,jdbcType=VARCHAR},
|
</if>
|
<if test="province != null" >
|
province = #{province,jdbcType=VARCHAR},
|
</if>
|
<if test="city != null" >
|
city = #{city,jdbcType=VARCHAR},
|
</if>
|
<if test="area != null" >
|
area = #{area,jdbcType=VARCHAR},
|
</if>
|
<if test="address != null" >
|
address = #{address,jdbcType=VARCHAR},
|
</if>
|
<if test="post != null" >
|
post = #{post,jdbcType=VARCHAR},
|
</if>
|
<if test="department != null" >
|
department = #{department,jdbcType=VARCHAR},
|
</if>
|
<if test="contactPhone != null" >
|
contact_phone = #{contactPhone,jdbcType=VARCHAR},
|
</if>
|
<if test="jobNumber != null" >
|
job_number = #{jobNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="jobState != null" >
|
job_state = #{jobState,jdbcType=TINYINT},
|
</if>
|
<if test="contractType != null" >
|
contract_type = #{contractType,jdbcType=VARCHAR},
|
</if>
|
<if test="registeredCapital != null" >
|
registered_capital = #{registeredCapital,jdbcType=VARCHAR},
|
</if>
|
<if test="companySecurityNumber != null" >
|
company_security_number = #{companySecurityNumber,jdbcType=VARCHAR},
|
</if>
|
<if test="assignmentCompanyName != null" >
|
assignment_company_name = #{assignmentCompanyName,jdbcType=VARCHAR},
|
</if>
|
<if test="natureCompany != null" >
|
nature_company = #{natureCompany,jdbcType=VARCHAR},
|
</if>
|
<if test="graduateSchool != null" >
|
graduate_school = #{graduateSchool,jdbcType=VARCHAR},
|
</if>
|
<if test="education != null" >
|
education = #{education,jdbcType=VARCHAR},
|
</if>
|
<if test="isValid != null" >
|
is_valid = #{isValid,jdbcType=TINYINT},
|
</if>
|
<if test="updateTime != null" >
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateUserId != null" >
|
update_user_id = #{updateUserId,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<update id="updateById" parameterType="cn.com.basic.security.entity.Se_Personnel" >
|
update se_personnel
|
set org_id = #{orgId,jdbcType=VARCHAR},
|
nation = #{nation,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
english_name = #{englishName,jdbcType=VARCHAR},
|
sex = #{sex,jdbcType=TINYINT},
|
age = #{age,jdbcType=TINYINT},
|
blood_type = #{bloodType,jdbcType=VARCHAR},
|
birth = #{birth,jdbcType=DATE},
|
id_number = #{idNumber,jdbcType=VARCHAR},
|
political_landscape = #{politicalLandscape,jdbcType=VARCHAR},
|
party_time = #{partyTime,jdbcType=TIMESTAMP},
|
head_pic = #{headPic,jdbcType=VARCHAR},
|
place_origin = #{placeOrigin,jdbcType=VARCHAR},
|
marriage = #{marriage,jdbcType=VARCHAR},
|
status = #{status,jdbcType=TINYINT},
|
home_address = #{homeAddress,jdbcType=VARCHAR},
|
health = #{health,jdbcType=VARCHAR},
|
registered_residence_type = #{registeredResidenceType,jdbcType=VARCHAR},
|
province = #{province,jdbcType=VARCHAR},
|
city = #{city,jdbcType=VARCHAR},
|
area = #{area,jdbcType=VARCHAR},
|
address = #{address,jdbcType=VARCHAR},
|
post = #{post,jdbcType=VARCHAR},
|
department = #{department,jdbcType=VARCHAR},
|
contact_phone = #{contactPhone,jdbcType=VARCHAR},
|
job_number = #{jobNumber,jdbcType=VARCHAR},
|
job_state = #{jobState,jdbcType=TINYINT},
|
contract_type = #{contractType,jdbcType=VARCHAR},
|
registered_capital = #{registeredCapital,jdbcType=VARCHAR},
|
company_security_number = #{companySecurityNumber,jdbcType=VARCHAR},
|
assignment_company_name = #{assignmentCompanyName,jdbcType=VARCHAR},
|
nature_company = #{natureCompany,jdbcType=VARCHAR},
|
graduate_school = #{graduateSchool,jdbcType=VARCHAR},
|
education = #{education,jdbcType=VARCHAR},
|
is_valid = #{isValid,jdbcType=TINYINT},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
update_user_id = #{updateUserId,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
<update id="updateValidById" parameterType="cn.com.basic.security.entity.Se_Personnel" >
|
update se_personnel set is_valid = #{isValid,jdbcType=TINYINT} where id = #{id,jdbcType=VARCHAR}
|
</update>
|
|
</mapper>
|