weaver-hrm-organization/src/com/engine/organization/mapper/version/CompanyVersionMapper.xml

101 lines
6.9 KiB
XML
Raw Normal View History

2022-12-09 08:50:23 +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.engine.organization.mapper.version.CompanyVersionMapper">
<resultMap id="BaseResultMap" type="com.engine.organization.entity.version.HrmSubCompanyVersion">
<result column="id" property="id"/>
<result column="subcomid" property="subComId"/>
<result column="subcompanydesc" property="subCompanyDesc"/>
<result column="subcompanycode" property="subCompanyCode"/>
<result column="subcompanyname" property="subCompanyName"/>
<result column="supssubcomid" property="supsSubComId"/>
<result column="showorder" property="showOrder"/>
<result column="canceled" property="canceled"/>
<result column="description" property="description"/>
<result column="operator" property="operator"/>
<result column="version" property="version"/>
<result column="operate_time" property="operateTime"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id ,t.subcomid ,t.subcompanydesc ,t.subcompanycode ,t.subcompanyname ,t.supsubcomid ,
t.showorder ,t.canceled ,t.description ,t.operator ,t.version ,t.operate_time
</sql>
2022-12-09 16:04:35 +08:00
<select id="getMaxVersion" resultMap="BaseResultMap" parameterType="java.lang.String">
2022-12-09 08:50:23 +08:00
select
<include refid="baseColumns"/>
2022-12-09 16:04:35 +08:00
from hrmsubcompany_version t where t.subcomid=#{subComId} order by t.version desc limit 1
2022-12-09 08:50:23 +08:00
</select>
2022-12-13 14:58:22 +08:00
<select id="getMaxVersion" resultMap="BaseResultMap" parameterType="java.lang.String" databaseId="oracle">
select * from (select <include refid="baseColumns"/> from hrmsubcompany_version t where t.subcomid=#{subComId} order by t.version desc) where rownum=1
</select>
<select id="getMaxVersion" resultMap="BaseResultMap" parameterType="java.lang.String" databaseId="sqlserver">
select top 1
<include refid="baseColumns"/>
from hrmsubcompany_version t where t.subcomid=#{subComId} order by t.version desc
</select>
2022-12-09 08:50:23 +08:00
<insert id="insertHrmSubComVersion">
insert into hrmsubcompany_version
(subcomid ,subcompanydesc ,subcompanycode ,subcompanyname ,supsubcomid ,
showorder ,canceled ,description ,operator ,version ,operate_time)
values (#{subComId}, #{subCompanyDesc}, #{subCompanyCode}, #{subCompanyName}, #{supsSubComId},
#{showOrder}, #{canceled}, #{description}, #{operator}, #{version}, #{operateTime})
</insert>
2022-12-09 16:04:35 +08:00
<select id="getMaxDeptVersion" resultType="com.engine.organization.entity.version.HrmDepartmentVersion">
select * from hrmdepartment_version where departmentid=#{departmentid} order by version desc limit 1
</select>
2022-12-13 14:58:22 +08:00
<select id="getMaxDeptVersion" resultType="com.engine.organization.entity.version.HrmDepartmentVersion" databaseId="oracle">
select * from (select * from hrmdepartment_version where departmentid=#{departmentid} order by version desc) where rownum=1
</select>
<select id="getMaxDeptVersion" resultType="com.engine.organization.entity.version.HrmDepartmentVersion" databaseId="sqlserver">
select top 1 * from hrmsubcompany_version where departmentid=#{departmentid} order by version desc
</select>
2022-12-09 08:50:23 +08:00
2022-12-09 16:04:35 +08:00
<insert id="insertHrmDeptVersion">
insert into hrmdepartment_version
(departmentid, departmentmark, departmentcode, departmentname, subcompanyid1, supdepid,
bmfzr, showorder, canceled, description, operator, version, operate_time)
VALUES (#{departmentId}, #{departmentMark}, #{departmentCode}, #{departmentName}, #{subCompanyId1}, #{supDepId},
#{bmfzr}, #{showOrder}, #{canceled}, #{description}, #{operator}, #{version}, #{operateTime})
2022-12-09 16:04:35 +08:00
</insert>
<select id="getMaxHrmVersion" resultType="com.engine.organization.entity.version.HrmResourceVersion">
2022-12-13 14:58:22 +08:00
select * from hrmresource_version where resourceid=#{resourceid} order by version desc limit 1
</select>
<select id="getMaxHrmVersion" resultType="com.engine.organization.entity.version.HrmResourceVersion" databaseId="oracle">
select * from (select * from hrmresource_version where resourceid=#{resourceid} order by version desc) where rownum=1
</select>
<select id="getMaxHrmVersion" resultType="com.engine.organization.entity.version.HrmResourceVersion" databaseId="sqlserver">
select top 1 * from hrmresource_version where resourceid=#{resourceid} order by version desc
2022-12-09 16:04:35 +08:00
</select>
<insert id="insertHrmResourceVersion">
insert into hrmresource_version
(resourceid, companystartdate, companyworkyear, workstartdate, workyear, usekind, jobcall,
accumfundaccount, birthplace, folk, residentphone, residentpostcode, extphone, managerstr,
status, fax, islabouunion, weight, tempresidentnumber, probationenddate, countryid, passwdchgdate,
lloginid, dsporder, passwordstate, accounttype, belongto, messagerurl, accountname,
loginid, password, lastname, sex, birthday, nationality, maritalstatus, telephone, mobile,
mobilecall, email, locationid, workroom, homeaddress, resourcetype, startdate, enddate, jobtitle,
jobactivitydesc, joblevel, seclevel, departmentid, subcompanyid1, costcenterid, managerid, assistantid,
bankid1, accountid1, resourceimageid, certificatenum, nativeplace, educationlevel, bememberdate,
bepartydate, workcode, regresidentplace, healthinfo, residentplace, policy, degree, height,
classification, description, operator, version, operate_time)
values (#{resourceid}, #{companystartdate}, #{companyworkyear}, #{workstartdate}, #{workyear}, #{usekind}, #{jobcall},
#{accumfundaccount}, #{birthplace}, #{folk}, #{residentphone}, #{residentpostcode}, #{extphone}, #{managerstr},
#{status}, #{fax}, #{islabouunion}, #{weight}, #{tempresidentnumber}, #{probationenddate}, #{countryid}, #{passwdchgdate},
#{lloginid}, #{dsporder}, #{passwordstate}, #{accounttype}, #{belongto}, #{messagerurl}, #{accountname},
#{loginid}, #{password}, #{lastname}, #{sex}, #{birthday}, #{nationality}, #{maritalstatus}, #{telephone}, #{mobile},
#{mobilecall}, #{email}, #{locationid}, #{workroom}, #{homeaddress}, #{resourcetype}, #{startdate}, #{enddate}, #{jobtitle},
#{jobactivitydesc}, #{joblevel}, #{seclevel}, #{departmentid}, #{subcompanyid1}, #{costcenterid}, #{managerid}, #{assistantid},
#{bankid1}, #{accountid1}, #{resourceimageid}, #{certificatenum}, #{nativeplace}, #{educationlevel}, #{bememberdate},
#{bepartydate}, #{workcode}, #{regresidentplace}, #{healthinfo}, #{residentplace}, #{policy}, #{degree}, #{height},
#{classification}, #{description}, #{operator}, #{version}, #{operateTime})
</insert>
2022-12-09 08:50:23 +08:00
</mapper>