设备管理系统camunda工作流
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
8.2 KiB

<?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.lnsoft.workflow.hxgk.mapper.PersonArchivesMapper">
<resultMap id="PersonResultMap" type="com.lnsoft.workflow.hxgk.entity.PersonArchives">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="number" column="number" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="mobilephone" column="mobilephone" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="positionName" column="position_name" jdbcType="VARCHAR"/>
<result property="companyName" column="company_name" jdbcType="VARCHAR"/>
<result property="jobName" column="job_name" jdbcType="VARCHAR"/>
<result property="maindeparmentName" column="maindeparment_name" jdbcType="VARCHAR"/>
<result property="gender" column="gender" jdbcType="TINYINT"/>
<result property="empType" column="emp_type" jdbcType="TINYINT"/>
<result property="icon" column="icon" jdbcType="VARCHAR"/>
<result property="hireClass" column="hire_class" jdbcType="TINYINT"/>
<result property="company" column="company" jdbcType="BIGINT"/>
<result property="maindeparment" column="maindeparment" jdbcType="BIGINT"/>
<result property="deparment" column="deparment" jdbcType="VARCHAR"/>
<result property="adminOrg" column="admin_org" jdbcType="BIGINT"/>
<result property="position" column="position" jdbcType="BIGINT"/>
<result property="jobClass" column="job_class" jdbcType="BIGINT"/>
<result property="jobId" column="job_id" jdbcType="BIGINT"/>
<result property="jobLeve" column="job_leve" jdbcType="BIGINT"/>
<result property="time" column="time" jdbcType="BIGINT"/>
<result property="eiteTime" column="eite_time" jdbcType="BIGINT"/>
<result property="wechat" column="wechat" jdbcType="VARCHAR"/>
<result property="workWechat" column="work_wechat" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="TINYINT"/>
<result property="key" column="key" jdbcType="BIGINT"/>
<result property="isAdmin" column="is_admin" jdbcType="TINYINT"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
<result property="role" column="role" jdbcType="VARCHAR"/>
<result property="empTypeName" column="emp_type_name" jdbcType="VARCHAR"/>
<result property="hireClassName" column="hire_class_name" jdbcType="VARCHAR"/>
<result property="sunMainDeparment" column="sun_main_deparment" jdbcType="BIGINT"/>
<result property="teamid" column="teamid" jdbcType="BIGINT"/>
<result property="ruleid" column="ruleid" jdbcType="BIGINT"/>
<result property="iconPhoto" column="icon_photo" jdbcType="VARCHAR"/>
<result property="personInCharge" column="person_in_charge" jdbcType="OTHER"/>
<result property="responsibleDepartment" column="responsible_department" jdbcType="VARCHAR"/>
<result property="responsibleDepartmentJson" column="responsible_department_json" jdbcType="VARCHAR"/>
<result property="workSection" column="work_section" jdbcType="BIGINT"/>
<result property="isShowTrue" column="is_show_true" jdbcType="OTHER"/>
<association property="administrativeOrganization" column="admin_org" foreignColumn="id"
javaType="com.lnsoft.workflow.hxgk.entity.AdministrativeOrganization" resultMap="OrgResultMap"/>
</resultMap>
<resultMap id="OrgResultMap" type="com.lnsoft.workflow.hxgk.entity.AdministrativeOrganization">
<id property="id" column="org_id" jdbcType="BIGINT"/>
<result property="number" column="org_number" jdbcType="VARCHAR"/>
<result property="name" column="org_name" jdbcType="VARCHAR"/>
<result property="superior" column="org_superior" jdbcType="BIGINT"/>
<result property="organizationType" column="org_organization_type" jdbcType="BIGINT"/>
<result property="abbreviation" column="org_abbreviation" jdbcType="VARCHAR"/>
<result property="state" column="org_state" jdbcType="TINYINT"/>
<result property="time" column="org_time" jdbcType="BIGINT"/>
<result property="wechatOrganizationId" column="org_wechat_organization_id" jdbcType="BIGINT"/>
<result property="superiorSun" column="org_superior_sun" jdbcType="VARCHAR"/>
<result property="schoole" column="org_schoole" jdbcType="BIGINT"/>
<result property="kingdeeid" column="org_kingdeeid" jdbcType="VARCHAR"/>
<result property="ispower" column="org_ispower" jdbcType="TINYINT"/>
<result property="sort" column="org_sort" jdbcType="OTHER"/>
</resultMap>
<sql id="person_Column_List">
per.id,per.number,per.name,
per.icon,per.hire_class,per.emp_type,
per.company,per.maindeparment,per.deparment,
per.admin_org,per.position,per.job_class,
per.job_id,per.job_leve,per.time,
per.eite_time,per.wechat,per.work_wechat,
per.state,per.key,per.is_admin,
per.password,per.role,per.emp_type_name,
per.hire_class_name,per.sun_main_deparment,per.teamid,
per.ruleid,per.icon_photo,per.person_in_charge,
per.responsible_department,per.responsible_department_json,per.work_section,
per.is_show_true
</sql>
<sql id="Org_Column_List">
org.id org_id,org.number org_number,org.name org_name,
org.superior org_superior,org.organization_type org_organization_type,org.abbreviation org_abbreviation,
org.state org_state,org.time org_time,org.wechat_organization_id org_wechat_organization_id,
org.superior_sun org_superior_sun,org.schoole org_schoole,org.kingdeeid org_kingdeeid,
org.ispower org_ispower,org.sort org_sort
</sql>
<select id="queryList" resultMap="PersonResultMap">
select <include refid="person_Column_List"/>,
<include refid="Org_Column_List"/>,per.number as loginno,
pos.name as position_name, du.name as job_name, con.gender,
company.name as company_name, maindeparment.name as maindeparment_name, con.mobilephone
from person_archives per
left join administrative_organization org on per.admin_org = org.id
left join administrative_organization company on per.company = company.id
left join administrative_organization maindeparment on per.maindeparment = maindeparment.id
left join personnel_content con on con.number = per.number
left join position pos on pos.id = per.position
left join duties du on du.id = per.job_id
where per.state = 1
<if test="orgIds != null and orgIds != ''">
AND org.id in
<foreach collection="orgIds" item="orgId" separator="," open="(" close=")">
#{orgId}
</foreach>
</if>
<if test="number != null and number != ''">
AND per.number in
<foreach collection="number.split(',')" item="num" separator="," open="(" close=")">
#{num}
</foreach>
</if>
<if test="name != null and name != ''">
AND per.name like concat('%', #{name}, '%')
</if>
<if test="teamid != null and teamid != ''">
AND per.teamid = #{teamid}
</if>
<if test="company != null and company != ''">
AND org.id = #{company}
</if>
</select>
<select id="queryPerList" resultMap="PersonResultMap">
select per.id, per.number, per.name, per.icon
from person_archives per
<where>
<if test="adminOrg != null and adminOrg != ''">
AND per.admin_org = #{adminOrg}
</if>
<if test="name != null and name != ''">
AND per.name like concat('%', #{name}, '%')
</if>
</where>
</select>
</mapper>