update code
parent
6edebbef77
commit
5978c46fc0
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.jh.project.domain;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
|
@ -16,6 +17,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
*/
|
||||
public class SurProjectAttendanceData extends BaseEntity
|
||||
{
|
||||
public SurProjectAttendanceData(){
|
||||
this.year= DateTime.now().year();
|
||||
}
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int year;
|
||||
|
|
|
@ -78,6 +78,7 @@ public class AttendanceJgwTask {
|
|||
public static void main(String[] args){
|
||||
String d="sxyzxx2024suc";
|
||||
System.out.println(Base64.encode(d));
|
||||
System.out.println(DateTime.now().year());
|
||||
|
||||
String appid="6a6f24fe35b04ee0bcf31cfb46ed1051";
|
||||
String secret="c3h5enh4MjAyNHN1Yw==";
|
||||
|
|
|
@ -8,45 +8,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="cfgid" column="cfgid" />
|
||||
<result property="appId" column="app_id" />
|
||||
<result property="projectId" column="projectId" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="deptId" />
|
||||
<result property="deptName" column="deptName" />
|
||||
<result property="vendorsCode" column="vendors_code" />
|
||||
<result property="serverid" column="serverid" />
|
||||
<result property="workerId" column="workerId" />
|
||||
<result property="attendanceType" column="attendance_type" />
|
||||
<result property="attendanceTime" column="attendance_time" />
|
||||
<result property="workerName" column="workerName" />
|
||||
<result property="identification" column="identification" />
|
||||
<result property="workerPhoto" column="workerPhoto" />
|
||||
<result property="workerGender" column="workerGender" />
|
||||
<result property="birthDate" column="birthDate" />
|
||||
<result property="ethnic" column="ethnic" />
|
||||
<result property="nativePlace" column="nativePlace" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="workTypeName" column="workTypeName" />
|
||||
<result property="specWorkType" column="specWorkType" />
|
||||
<result property="groupName" column="groupName" />
|
||||
<result property="companyTypeId" column="companyTypeId" />
|
||||
<result property="companyName" column="companyName" />
|
||||
<result property="attendanceTime" column="attendance_time" />
|
||||
<result property="attendanceOutTime" column="attendance_out_time" />
|
||||
<result property="scanPhoto" column="scanPhoto" />
|
||||
<result property="teamId" column="teamId" />
|
||||
<result property="workTypeCode" column="workTypeCode" />
|
||||
<result property="companyId" column="companyId" />
|
||||
<result property="vendorId" column="vendorId" />
|
||||
<result property="projectType" column="projectType" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="workPointId" column="work_point_id" />
|
||||
<result property="scanPhoto" column="scanPhoto" />
|
||||
<result property="other" column="other" />
|
||||
<result property="state" column="state" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="subDeptId" column="sub_dept_id"/>
|
||||
<result property="companyTypeId" column="companyTypeId"/>
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectAttendanceDataVo">
|
||||
select * FROM
|
||||
(
|
||||
select a.*,b.project_id,b.sub_dept_id,c.companyTypeId
|
||||
from sur_project_attendance_data a,sur_project_attendance_cfg b,view_sur_project_attendance_group c
|
||||
where a.cfgid=b.id and a.companyId=c.companyId
|
||||
select a.*
|
||||
from sur_project_attendance_data_${year} a
|
||||
)
|
||||
sur_project_attendance_data
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectAttendanceDataListEx" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select * from sur_project_attendance_data
|
||||
select * from sur_project_attendance_data_${year}
|
||||
<where>
|
||||
<if test="cfgid != null "> and cfgid = #{cfgid}</if>
|
||||
<if test="appId != null "> and app_id = #{appId}</if>
|
||||
|
@ -100,120 +108,156 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectAttendanceData" parameterType="SurProjectAttendanceData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_data
|
||||
<insert id="insertSurProjectAttendanceData2024" parameterType="SurProjectAttendanceData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_attendance_data_${year}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid,</if>
|
||||
<if test="appId != null">app_id,</if>
|
||||
<if test="projectId != null">projectId,</if>
|
||||
<if test="projectName != null">projectName,</if>
|
||||
<if test="deptId != null">deptId,</if>
|
||||
<if test="deptName != null">deptName,</if>
|
||||
<if test="vendorsCode != null">vendors_code,</if>
|
||||
<if test="serverid != null">serverid,</if>
|
||||
<if test="workerId != null">workerId,</if>
|
||||
<if test="attendanceType != null">attendance_type,</if>
|
||||
<if test="attendanceTime != null">attendance_time,</if>
|
||||
<if test="workerName != null">workerName,</if>
|
||||
<if test="identification != null">identification,</if>
|
||||
<if test="workerPhoto != null">workerPhoto,</if>
|
||||
<if test="workerGender != null">workerGender,</if>
|
||||
<if test="birthDate != null">birthDate,</if>
|
||||
<if test="ethnic != null">ethnic,</if>
|
||||
<if test="nativePlace != null">nativePlace,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="workTypeName != null">workTypeName,</if>
|
||||
<if test="specWorkType != null">specWorkType,</if>
|
||||
<if test="groupName != null">groupName,</if>
|
||||
<if test="companyTypeId != null">companyTypeId,</if>
|
||||
<if test="companyName != null">companyName,</if>
|
||||
<if test="attendanceTime != null">attendance_time,</if>
|
||||
<if test="attendanceOutTime != null">attendance_out_time,</if>
|
||||
<if test="scanPhoto != null">scanPhoto,</if>
|
||||
<if test="teamId != null">teamId,</if>
|
||||
<if test="workTypeCode != null">workTypeCode,</if>
|
||||
<if test="companyId != null">companyId,</if>
|
||||
<if test="vendorId != null">vendorId,</if>
|
||||
<if test="projectType != null">projectType,</if>
|
||||
<if test="deviceCode != null">device_code,</if>
|
||||
<if test="workPointId != null">work_point_id,</if>
|
||||
<if test="scanPhoto != null">scanPhoto,</if>
|
||||
<if test="other != null">other,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cfgid != null">#{cfgid},</if>
|
||||
<if test="appId != null">#{appId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="projectName != null">#{projectName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="vendorsCode != null">#{vendorsCode},</if>
|
||||
<if test="serverid != null">#{serverid},</if>
|
||||
<if test="workerId != null">#{workerId},</if>
|
||||
<if test="attendanceType != null">#{attendanceType},</if>
|
||||
<if test="attendanceTime != null">#{attendanceTime},</if>
|
||||
<if test="workerName != null">#{workerName},</if>
|
||||
<if test="identification != null">#{identification},</if>
|
||||
<if test="workerPhoto != null">#{workerPhoto},</if>
|
||||
<if test="workerGender != null">#{workerGender},</if>
|
||||
<if test="birthDate != null">#{birthDate},</if>
|
||||
<if test="ethnic != null">#{ethnic},</if>
|
||||
<if test="nativePlace != null">#{nativePlace},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="workTypeName != null">#{workTypeName},</if>
|
||||
<if test="specWorkType != null">#{specWorkType},</if>
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="companyTypeId != null">#{companyTypeId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="attendanceTime != null">#{attendanceTime},</if>
|
||||
<if test="attendanceOutTime != null">#{attendanceOutTime},</if>
|
||||
<if test="scanPhoto != null">#{scanPhoto},</if>
|
||||
<if test="teamId != null">#{teamId},</if>
|
||||
<if test="workTypeCode != null">#{workTypeCode},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="vendorId != null">#{vendorId},</if>
|
||||
<if test="projectType != null">#{projectType},</if>
|
||||
<if test="deviceCode != null">#{deviceCode},</if>
|
||||
<if test="workPointId != null">#{workPointId},</if>
|
||||
<if test="scanPhoto != null">#{scanPhoto},</if>
|
||||
<if test="other != null">#{other},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSurProjectAttendanceData" parameterType="SurProjectAttendanceData">
|
||||
update sur_project_attendance_data
|
||||
<update id="updateSurProjectAttendanceData2024" parameterType="SurProjectAttendanceData">
|
||||
update sur_project_attendance_data_${year}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cfgid != null">cfgid = #{cfgid},</if>
|
||||
<if test="appId != null">app_id = #{appId},</if>
|
||||
<if test="projectId != null">projectId = #{projectId},</if>
|
||||
<if test="projectName != null">projectName = #{projectName},</if>
|
||||
<if test="deptId != null">deptId = #{deptId},</if>
|
||||
<if test="deptName != null">deptName = #{deptName},</if>
|
||||
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||
<if test="serverid != null">serverid = #{serverid},</if>
|
||||
<if test="workerId != null">workerId = #{workerId},</if>
|
||||
<if test="attendanceType != null">attendance_type = #{attendanceType},</if>
|
||||
<if test="attendanceTime != null">attendance_time = #{attendanceTime},</if>
|
||||
<if test="workerName != null">workerName = #{workerName},</if>
|
||||
<if test="identification != null">identification = #{identification},</if>
|
||||
<if test="workerPhoto != null">workerPhoto = #{workerPhoto},</if>
|
||||
<if test="workerGender != null">workerGender = #{workerGender},</if>
|
||||
<if test="birthDate != null">birthDate = #{birthDate},</if>
|
||||
<if test="ethnic != null">ethnic = #{ethnic},</if>
|
||||
<if test="nativePlace != null">nativePlace = #{nativePlace},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="workTypeName != null">workTypeName = #{workTypeName},</if>
|
||||
<if test="specWorkType != null">specWorkType = #{specWorkType},</if>
|
||||
<if test="groupName != null">groupName = #{groupName},</if>
|
||||
<if test="companyTypeId != null">companyTypeId = #{companyTypeId},</if>
|
||||
<if test="companyName != null">companyName = #{companyName},</if>
|
||||
<if test="attendanceTime != null">attendance_time = #{attendanceTime},</if>
|
||||
<if test="attendanceOutTime != null">attendance_out_time = #{attendanceOutTime},</if>
|
||||
<if test="scanPhoto != null">scanPhoto = #{scanPhoto},</if>
|
||||
<if test="teamId != null">teamId = #{teamId},</if>
|
||||
<if test="workTypeCode != null">workTypeCode = #{workTypeCode},</if>
|
||||
<if test="companyId != null">companyId = #{companyId},</if>
|
||||
<if test="vendorId != null">vendorId = #{vendorId},</if>
|
||||
<if test="projectType != null">projectType = #{projectType},</if>
|
||||
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
||||
<if test="workPointId != null">work_point_id = #{workPointId},</if>
|
||||
<if test="scanPhoto != null">scanPhoto = #{scanPhoto},</if>
|
||||
<if test="other != null">other = #{other},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataById" parameterType="Long">
|
||||
delete from sur_project_attendance_data where id = #{id}
|
||||
delete from sur_project_attendance_data_${year} where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataByIds" parameterType="String">
|
||||
delete from sur_project_attendance_data where id in
|
||||
delete from sur_project_attendance_data_${year} where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSurProjectAttendanceDataByParams" parameterType="String">
|
||||
delete from sur_project_attendance_data where CONCAT(app_id,'-',serverid,'-',workerId) in
|
||||
delete from sur_project_attendance_data_${year} where CONCAT(app_id,'-',serverid,'-',workerId) in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchSurProjectAttendanceData">
|
||||
insert into sur_project_attendance_data( id, cfgid, app_id, vendors_code, serverid, workerId, attendance_type, attendance_time, identification, teamId, workTypeCode, companyId, vendorId, projectType, device_code, work_point_id, scanPhoto, other, state, remark, is_del, create_by, create_time, update_by, update_time) values
|
||||
insert into sur_project_attendance_data_${year}( id, cfgid, app_id, vendors_code, serverid, workerId, attendance_type, attendance_time, identification, teamId, workTypeCode, companyId, vendorId, projectType, device_code, work_point_id, scanPhoto, other, state, remark, is_del, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.cfgid},#{item.appId}, #{item.vendorsCode}, #{item.serverid}, #{item.workerId}, #{item.attendanceType}, #{item.attendanceTime}, #{item.identification}, #{item.teamId}, #{item.workTypeCode}, #{item.companyId}, #{item.vendorId}, #{item.projectType}, #{item.deviceCode}, #{item.workPointId}, #{item.scanPhoto}, #{item.other}, #{item.state}, #{item.remark}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getLastServerId" parameterType="SurProjectAttendanceData" resultType="Long">
|
||||
SELECT IF(MAX(serverid+0),MAX(serverid+0),0) serverid FROM sur_project_attendance_data WHERE cfgid=#{cfgid}
|
||||
SELECT IF(MAX(serverid+0),MAX(serverid+0),0) serverid FROM sur_project_attendance_data_${year} WHERE cfgid=#{cfgid}
|
||||
</select>
|
||||
<select id="groupByComanyOld" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
|
||||
select companyTypeId,count(1) id from ( <include refid="selectSurProjectAttendanceDataVo"/> ) x2 where id in (
|
||||
|
@ -291,6 +335,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getHuazhuPage" parameterType="long" resultType="Long">
|
||||
select max(vendorId) vendorId from sur_project_attendance_data WHERE cfgid=#{id}
|
||||
select max(vendorId) vendorId from sur_project_attendance_data_${year} WHERE cfgid=#{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue