2024-08-25 13:31:15 +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.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper" >
2025-01-04 18:20:48 +08:00
2024-08-25 13:31:15 +08:00
<resultMap type= "ProProjectInfoSubdeptsUsers" id= "ProProjectInfoSubdeptsUsersResult" >
<result property= "id" column= "id" />
2024-12-20 20:24:08 +08:00
<result property= "parId" column= "par_id" />
2024-09-09 23:58:23 +08:00
<result property= "comId" column= "com_id" />
2025-01-04 18:20:48 +08:00
<result property= "comName" column= "com_name" />
2024-08-25 13:31:15 +08:00
<result property= "projectId" column= "project_id" />
2024-10-13 23:18:53 +08:00
<result property= "projectName" column= "project_name" />
2024-08-25 13:31:15 +08:00
<result property= "subDeptId" column= "sub_dept_id" />
2024-09-09 23:58:23 +08:00
<result property= "subDeptType" column= "sub_dept_type" />
2024-12-22 19:55:21 +08:00
<result property= "subDeptTypeName" column= "sub_dept_type_name" />
2024-08-25 13:31:15 +08:00
<result property= "subDeptName" column= "sub_dept_name" />
2024-12-17 20:25:21 +08:00
<result property= "subDeptPowerPath" column= "sub_dept_power_path" />
2024-08-25 13:31:15 +08:00
<result property= "userId" column= "user_id" />
2025-01-04 18:20:48 +08:00
<result property= "userPost" column= "user_post" />
2024-10-01 16:35:07 +08:00
<result property= "subDeptGroup" column= "sub_dept_group" />
2024-10-08 01:07:33 +08:00
<result property= "subDeptGroupName" column= "sub_dept_group_name" />
2025-01-04 18:20:48 +08:00
<result property= "userName" column= "user_name" />
<result property= "cardType" column= "card_type" />
2025-02-09 21:56:02 +08:00
<result property= "workType" column= "work_type" />
2025-01-04 18:20:48 +08:00
<result property= "cardCode" column= "card_code" />
<result property= "userSex" column= "user_sex" />
<result property= "userPicture" column= "user_picture" />
<result property= "userPhone" column= "user_phone" />
<result property= "degreeGrade" column= "degree_grade" />
<result property= "degreeGradeName" column= "degree_grade_name" />
<result property= "userInfos" column= "user_infos" />
2024-08-25 13:31:15 +08:00
<result property= "craftType" column= "craft_type" />
2025-01-04 18:20:48 +08:00
<result property= "craftTypeName" column= "craft_type_name" />
2024-08-25 13:31:15 +08:00
<result property= "craftPost" column= "craft_post" />
2025-01-04 18:20:48 +08:00
<result property= "craftPostName" column= "craft_post_name" />
2024-08-25 13:31:15 +08:00
<result property= "eduStatus" column= "edu_status" />
<result property= "eduFilePath" column= "edu_file_path" />
<result property= "eduDate" column= "edu_date" />
<result property= "approveStatus" column= "approve_status" />
2025-01-04 18:20:48 +08:00
<result property= "useDate" column= "use_date" />
2024-08-25 13:31:15 +08:00
<result property= "useStatus" column= "use_status" />
2025-01-04 18:20:48 +08:00
<result property= "admitGuid" column= "admit_guid" />
2025-01-05 01:03:30 +08:00
<result property= "faceGuid" column= "face_guid" />
2024-12-20 20:24:08 +08:00
<result property= "qrCode" column= "qr_code" />
2024-08-25 13:31:15 +08:00
<result property= "subStep" column= "sub_step" />
<result property= "illnessStatus" column= "illness_status" />
<result property= "supIllnessStatus" column= "sup_illness_status" />
<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= "remark" column= "remark" />
</resultMap>
2024-12-29 11:46:50 +08:00
2024-08-25 13:31:15 +08:00
<sql id= "selectProProjectInfoSubdeptsUsersVo" >
2025-01-04 18:20:48 +08:00
select psu.id, psu.par_id, psu.com_id, psu.project_id, pi.project_name, psu.sub_dept_id, psu.sub_dept_type, dic3.dict_label as sub_dept_type_name, psu.sub_dept_name, psu.sub_dept_power_path, psu.user_id, psu.user_post, psu.sub_dept_group,
2025-02-05 21:34:18 +08:00
psu.sub_dept_group_name, psu.user_name, psu.card_type, psu.card_code, psu.user_sex, psu.user_picture, psu.user_phone, psu.degree_grade, dic4.dict_label as degree_grade_name, psu.user_infos, psu.craft_type, dic1.dict_label as craft_type_name, psu.craft_post, dic2.dict_label as craft_post_name, psu.edu_status, psu.edu_file_path, psu.edu_date, psu.approve_status,
2025-01-04 18:20:48 +08:00
psu.use_date, psu.use_status, psu.admit_guid, psu.qr_code, psu.sub_step, psu.illness_status, psu.sup_illness_status, psu.is_del, psu.create_by, psu.create_time, psu.update_by, psu.update_time,
2025-02-09 21:56:02 +08:00
psu.remark,psu.face_guid,sd.dept_name com_name,psu.work_type
2025-01-04 18:20:48 +08:00
from pro_project_info_subdepts_users psu
left join pro_project_info pi on pi.id = psu.project_id
2025-02-17 00:10:20 +08:00
left join sys_dept sd on sd.dept_id = psu.com_id
2025-01-04 18:20:48 +08:00
left join sys_dict_data dic1 on psu.`craft_type`=dic1.`dict_value` and dic1.`dict_type`='pro_craft_type'
left join sys_dict_data dic2 on psu.`craft_post`=dic2.`dict_value` and dic2.`dict_type`='pro_craft_post'
left join sys_dict_data dic3 on psu.`sub_dept_type`=dic3.`dict_value` and dic3.`dict_type`='sub_dept_type'
left join sys_dict_data dic4 on psu.`degree_grade`=dic4.`dict_value` and dic4.`dict_type`='educational_type'
2024-08-25 13:31:15 +08:00
</sql>
<select id= "selectProProjectInfoSubdeptsUsersList" parameterType= "ProProjectInfoSubdeptsUsers" resultMap= "ProProjectInfoSubdeptsUsersResult" >
<include refid= "selectProProjectInfoSubdeptsUsersVo" />
2024-08-25 21:25:51 +08:00
<where >
2024-10-08 23:39:19 +08:00
<if test= "comId != null " > and psu.com_id = #{comId}</if>
2024-12-20 20:24:08 +08:00
<if test= "parId != null " > and psu.par_id = #{parId}</if>
2024-10-08 23:39:19 +08:00
<if test= "projectId != null " > and psu.project_id = #{projectId}</if>
<if test= "subDeptId != null " > and psu.sub_dept_id = #{subDeptId}</if>
<if test= "subDeptType != null and subDeptType != ''" > and psu.sub_dept_type = #{subDeptType}</if>
<if test= "subDeptName != null and subDeptName != ''" > and psu.sub_dept_name like concat('%', #{subDeptName}, '%')</if>
<if test= "userId != null " > and psu.user_id = #{userId}</if>
2025-01-04 18:20:48 +08:00
<if test= "userPost != null " > and psu.user_post = #{userPost}</if>
2024-10-08 23:39:19 +08:00
<if test= "subDeptGroup != null " > and psu.sub_dept_group = #{subDeptGroup}</if>
<if test= "subDeptGroupName != null and subDeptGroupName != ''" > and psu.sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
2025-02-09 21:56:02 +08:00
<if test= "workType != null and workType != 0" > and psu.work_type = #{workType}</if>
2024-10-08 23:39:19 +08:00
<if test= "craftType != null and craftType != ''" > and psu.craft_type = #{craftType}</if>
<if test= "craftPost != null and craftPost != ''" > and psu.craft_post = #{craftPost}</if>
<if test= "eduStatus != null and eduStatus != ''" > and psu.edu_status = #{eduStatus}</if>
<if test= "eduDate != null " > and psu.edu_date = #{eduDate}</if>
<if test= "approveStatus != null " > and psu.approve_status = #{approveStatus}</if>
<if test= "useStatus != null and useStatus != ''" > and psu.use_status = #{useStatus}</if>
2025-01-04 18:20:48 +08:00
<if test= "admitGuid!=null and admitGuid!=''" > and psu.admit_guid = #{admitGuid}</if>
2025-01-05 01:03:30 +08:00
<if test= "faceGuid!=null and faceGuid!=''" > and psu.face_guid = #{faceGuid}</if>
2024-10-08 23:39:19 +08:00
<if test= "subStep != null " > and psu.sub_step = #{subStep}</if>
<if test= "illnessStatus != null " > and psu.illness_status = #{illnessStatus}</if>
<if test= "supIllnessStatus != null " > and psu.sup_illness_status = #{supIllnessStatus}</if>
2025-01-04 18:20:48 +08:00
<if test= "userPhone != null and userPhone != ''" > and psu.user_phone = #{userPhone}</if>
2025-01-05 17:09:13 +08:00
<if test= 'activeTags == "finished"' > and psu.approve_status <![CDATA[ >= ]]> 100 </if>
2024-10-08 23:39:19 +08:00
<if test= "isDel != null " > and psu.is_del = #{isDel}</if>
2025-03-05 23:22:11 +08:00
<if test= 'searchValue == "subUsers"' > and psu.user_post != '66' </if>
<if test= 'searchValue == "sedUsers"' > and psu.sub_dept_type in ('1','4','5') and psu.user_post not in ('4','5') </if>
2025-02-19 22:22:39 +08:00
<if test= "params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''" > and date(psu.use_date) between #{params.beginTime} and #{params.endTime}</if>
2025-01-05 14:50:38 +08:00
and psu.is_del != 2
2024-08-25 13:31:15 +08:00
</where>
</select>
2024-10-08 01:07:33 +08:00
2024-08-25 13:31:15 +08:00
<select id= "selectProProjectInfoSubdeptsUsersById" parameterType= "Long" resultMap= "ProProjectInfoSubdeptsUsersResult" >
<include refid= "selectProProjectInfoSubdeptsUsersVo" />
2024-10-08 23:39:19 +08:00
where psu.id = #{id}
2024-08-25 13:31:15 +08:00
</select>
2024-10-08 01:07:33 +08:00
2024-12-17 20:25:21 +08:00
<select id= "selectProProjectInfoSubdeptsUsersByParamId" resultMap= "ProProjectInfoSubdeptsUsersResult" >
<include refid= "selectProProjectInfoSubdeptsUsersVo" />
where psu.project_id = #{proId} and psu.user_id = #{userId}
</select>
2024-08-25 13:31:15 +08:00
<insert id= "insertProProjectInfoSubdeptsUsers" parameterType= "ProProjectInfoSubdeptsUsers" useGeneratedKeys= "true" keyProperty= "id" >
insert into pro_project_info_subdepts_users
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
2024-12-20 20:24:08 +08:00
<if test= "parId != null" > par_id,</if>
2024-09-09 23:58:23 +08:00
<if test= "comId != null" > com_id,</if>
2024-08-25 13:31:15 +08:00
<if test= "projectId != null" > project_id,</if>
<if test= "subDeptId != null" > sub_dept_id,</if>
2024-10-01 16:35:07 +08:00
<if test= "subDeptType != null" > sub_dept_type,</if>
2024-08-25 13:31:15 +08:00
<if test= "subDeptName != null" > sub_dept_name,</if>
2024-12-17 20:25:21 +08:00
<if test= "subDeptPowerPath != null" > sub_dept_power_path,</if>
2024-08-25 13:31:15 +08:00
<if test= "userId != null" > user_id,</if>
2025-01-04 18:20:48 +08:00
<if test= "userPost != null" > user_post,</if>
2024-10-01 16:35:07 +08:00
<if test= "subDeptGroup != null" > sub_dept_group,</if>
<if test= "subDeptGroupName != null" > sub_dept_group_name,</if>
2025-01-04 18:20:48 +08:00
<if test= "userName != null" > user_name,</if>
<if test= "cardType != null" > card_type,</if>
2025-02-09 21:56:02 +08:00
<if test= "workType != null" > work_type,</if>
2025-01-04 18:20:48 +08:00
<if test= "cardCode != null" > card_code,</if>
<if test= "userSex != null" > user_sex,</if>
<if test= "userPicture != null" > user_picture,</if>
<if test= "userPhone != null" > user_phone,</if>
<if test= "degreeGrade != null" > degree_grade,</if>
<if test= "userInfos != null" > user_infos,</if>
2024-08-25 13:31:15 +08:00
<if test= "craftType != null" > craft_type,</if>
<if test= "craftPost != null" > craft_post,</if>
<if test= "eduStatus != null" > edu_status,</if>
<if test= "eduFilePath != null" > edu_file_path,</if>
<if test= "eduDate != null" > edu_date,</if>
<if test= "approveStatus != null" > approve_status,</if>
2025-01-04 18:20:48 +08:00
<if test= "useDate != null" > use_date,</if>
2024-08-25 13:31:15 +08:00
<if test= "useStatus != null" > use_status,</if>
2025-01-04 18:20:48 +08:00
<if test= "admitGuid != null" > admit_guid,</if>
2025-01-05 01:03:30 +08:00
<if test= "faceGuid != null" > face_guid,</if>
2024-12-20 20:24:08 +08:00
<if test= "qrCode != null" > qr_code,</if>
2024-08-25 13:31:15 +08:00
<if test= "subStep != null" > sub_step,</if>
<if test= "illnessStatus != null" > illness_status,</if>
<if test= "supIllnessStatus != null" > sup_illness_status,</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>
2024-10-08 01:07:33 +08:00
</trim>
2024-08-25 13:31:15 +08:00
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
2024-12-20 20:24:08 +08:00
<if test= "parId != null" > #{parId},</if>
2024-09-09 23:58:23 +08:00
<if test= "comId != null" > #{comId},</if>
2024-08-25 13:31:15 +08:00
<if test= "projectId != null" > #{projectId},</if>
<if test= "subDeptId != null" > #{subDeptId},</if>
2024-10-01 16:35:07 +08:00
<if test= "subDeptType != null" > #{subDeptType},</if>
2024-08-25 13:31:15 +08:00
<if test= "subDeptName != null" > #{subDeptName},</if>
2024-12-17 20:25:21 +08:00
<if test= "subDeptPowerPath != null" > #{subDeptPowerPath},</if>
2024-08-25 13:31:15 +08:00
<if test= "userId != null" > #{userId},</if>
2025-01-04 18:20:48 +08:00
<if test= "userPost != null" > #{userPost},</if>
2024-10-01 16:35:07 +08:00
<if test= "subDeptGroup != null" > #{subDeptGroup},</if>
<if test= "subDeptGroupName != null" > #{subDeptGroupName},</if>
2025-01-04 18:20:48 +08:00
<if test= "userName != null" > #{userName},</if>
<if test= "cardType != null" > #{cardType},</if>
2025-02-09 21:56:02 +08:00
<if test= "workType != null" > #{workType},</if>
2025-01-04 18:20:48 +08:00
<if test= "cardCode != null" > #{cardCode},</if>
<if test= "userSex != null" > #{userSex},</if>
<if test= "userPicture != null" > #{userPicture},</if>
<if test= "userPhone != null" > #{userPhone},</if>
<if test= "degreeGrade != null" > #{degreeGrade},</if>
<if test= "userInfos != null" > #{userInfos},</if>
2024-08-25 13:31:15 +08:00
<if test= "craftType != null" > #{craftType},</if>
<if test= "craftPost != null" > #{craftPost},</if>
<if test= "eduStatus != null" > #{eduStatus},</if>
<if test= "eduFilePath != null" > #{eduFilePath},</if>
<if test= "eduDate != null" > #{eduDate},</if>
<if test= "approveStatus != null" > #{approveStatus},</if>
2025-01-04 18:20:48 +08:00
<if test= "useDate != null" > #{useDate},</if>
2024-08-25 13:31:15 +08:00
<if test= "useStatus != null" > #{useStatus},</if>
2025-01-04 18:20:48 +08:00
<if test= "admitGuid != null" > #{admitGuid},</if>
2025-01-05 01:03:30 +08:00
<if test= "faceGuid != null" > #{faceGuid},</if>
2024-12-20 20:24:08 +08:00
<if test= "qrCode != null" > #{qrCode},</if>
2024-08-25 13:31:15 +08:00
<if test= "subStep != null" > #{subStep},</if>
<if test= "illnessStatus != null" > #{illnessStatus},</if>
<if test= "supIllnessStatus != null" > #{supIllnessStatus},</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>
2024-10-08 01:07:33 +08:00
</trim>
2024-08-25 13:31:15 +08:00
</insert>
<update id= "updateProProjectInfoSubdeptsUsers" parameterType= "ProProjectInfoSubdeptsUsers" >
update pro_project_info_subdepts_users
<trim prefix= "SET" suffixOverrides= "," >
2024-12-20 20:24:08 +08:00
<if test= "parId != null" > par_id = #{parId},</if>
2024-09-09 23:58:23 +08:00
<if test= "comId != null" > com_id = #{comId},</if>
2024-08-25 13:31:15 +08:00
<if test= "projectId != null" > project_id = #{projectId},</if>
<if test= "subDeptId != null" > sub_dept_id = #{subDeptId},</if>
2024-10-01 16:35:07 +08:00
<if test= "subDeptType != null" > sub_dept_type = #{subDeptType},</if>
2024-08-25 13:31:15 +08:00
<if test= "subDeptName != null" > sub_dept_name = #{subDeptName},</if>
2024-12-17 20:25:21 +08:00
<if test= "subDeptPowerPath != null" > sub_dept_power_path = #{subDeptPowerPath},</if>
2024-08-25 13:31:15 +08:00
<if test= "userId != null" > user_id = #{userId},</if>
2025-01-04 18:20:48 +08:00
<if test= "userPost != null" > user_post = #{userPost},</if>
2024-10-01 16:35:07 +08:00
<if test= "subDeptGroup != null" > sub_dept_group = #{subDeptGroup},</if>
<if test= "subDeptGroupName != null" > sub_dept_group_name = #{subDeptGroupName},</if>
2025-01-04 18:20:48 +08:00
<if test= "userName != null" > user_name = #{userName},</if>
<if test= "cardType != null" > card_type = #{cardType},</if>
2025-02-09 21:56:02 +08:00
<if test= "workType != null" > work_type = #{workType},</if>
2025-01-04 18:20:48 +08:00
<if test= "cardCode != null" > card_code = #{cardCode},</if>
<if test= "userSex != null" > user_sex = #{userSex},</if>
<if test= "userPicture != null" > user_picture = #{userPicture},</if>
<if test= "userPhone != null" > user_phone = #{userPhone},</if>
<if test= "degreeGrade != null" > degree_grade = #{degreeGrade},</if>
<if test= "userInfos != null" > user_infos = #{userInfos},</if>
2024-08-25 13:31:15 +08:00
<if test= "craftType != null" > craft_type = #{craftType},</if>
<if test= "craftPost != null" > craft_post = #{craftPost},</if>
<if test= "eduStatus != null" > edu_status = #{eduStatus},</if>
<if test= "eduFilePath != null" > edu_file_path = #{eduFilePath},</if>
<if test= "eduDate != null" > edu_date = #{eduDate},</if>
<if test= "approveStatus != null" > approve_status = #{approveStatus},</if>
2025-01-04 18:20:48 +08:00
<if test= "useDate != null" > use_date = #{useDate},</if>
2024-08-25 13:31:15 +08:00
<if test= "useStatus != null" > use_status = #{useStatus},</if>
2025-01-04 18:20:48 +08:00
<if test= "admitGuid != null" > admit_guid = #{admitGuid},</if>
2025-01-05 01:03:30 +08:00
<if test= "faceGuid != null" > face_guid = #{faceGuid},</if>
2024-12-20 20:24:08 +08:00
<if test= "qrCode != null" > qr_code = #{qrCode},</if>
2024-08-25 13:31:15 +08:00
<if test= "subStep != null" > sub_step = #{subStep},</if>
<if test= "illnessStatus != null" > illness_status = #{illnessStatus},</if>
<if test= "supIllnessStatus != null" > sup_illness_status = #{supIllnessStatus},</if>
2025-01-05 17:09:13 +08:00
<if test= "sortBy != null" > sort_by = #{sortBy},</if>
2024-08-25 13:31:15 +08:00
<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>
2025-01-04 18:20:48 +08:00
<update id= "deleteProProjectInfoSubdeptsUsersById" parameterType= "Long" >
update pro_project_info_subdepts_users set is_del = 2 where id = #{id}
</update>
2024-08-25 13:31:15 +08:00
2025-01-04 18:20:48 +08:00
<update id= "deleteProProjectInfoSubdeptsUsersByIds" parameterType= "String" >
update pro_project_info_subdepts_users set is_del = 2 where id in
2024-08-25 13:31:15 +08:00
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
2025-01-04 18:20:48 +08:00
</update>
2024-09-22 21:18:11 +08:00
<select id= "findUserByUserPhone" parameterType= "String" resultType= "int" >
select count(1) from sys_user where phonenumber=#{phonenumber}
</select>
2024-12-07 12:49:34 +08:00
<select id= "groupByCraftType" parameterType= "ProProjectInfoSubdeptsUsers" resultMap= "ProProjectInfoSubdeptsUsersResult" >
SELECT
dic.dict_value craft_type,
dic.dict_label create_by,
u.id
FROM
sys_dict_data dic
LEFT JOIN (
SELECT
craft_type,
COUNT(1) AS id
FROM
pro_project_info_subdepts_users
WHERE
2025-01-04 18:20:48 +08:00
use_status = 0
2024-12-07 12:49:34 +08:00
<if test= "comId != null" > and com_id = #{comId}</if>
<if test= "projectId != null" > and project_id = #{projectId}</if>
GROUP BY
craft_type
) u
ON u.craft_type = dic.dict_value
WHERE
2025-01-04 00:53:16 +08:00
dic.dict_type = 'pro_craft_type'
2024-12-07 12:49:34 +08:00
</select>
<select id= "groupByCraftTypeByAttendance" parameterType= "ProProjectInfoSubdeptsUsers" resultMap= "ProProjectInfoSubdeptsUsersResult" >
SELECT
dic.dict_value craft_type,
dic.dict_label create_by,
u.id
FROM
sys_dict_data dic
LEFT JOIN (
SELECT
craft_type,
COUNT(1) AS id
FROM
pro_project_info_subdepts_users
WHERE
user_id in (select userId
from attendance_ubi_data
<where >
<if test= "comId != null" > and com_id = #{comId}</if>
<if test= "projectId != null" > and project_id = #{projectId}</if>
<if test= "createTime != null" >
and (date(inTime)= date( #{createTime}) or date(outTime)=date( #{createTime})))</if>
</where>
GROUP BY
craft_type
) u
ON u.craft_type = dic.dict_value
WHERE
dic.dict_type = 'pro_craft_type'
</select>
2024-12-18 22:34:51 +08:00
<select id= "findActReProcdefDept" resultType= "Map" >
2024-12-22 19:55:21 +08:00
select * from act_re_procdef rp
left join act_re_procdef_dept rpd on rpd.PROCDEF_ID_ = rp.ID_
where rp.SUSPENSION_STATE_ = 1 and PROJ_ID_ = #{proId} and TYPE_ = #{defType} order by SORT_ desc
2024-12-18 22:34:51 +08:00
</select>
2024-12-29 11:46:50 +08:00
<select id= "statsSubDeptsUsersByProId" parameterType= "ProProjectInfoSubdeptsUsers" resultType= "Map" >
select u.craft_type as craftType, u.use_status as useStatus,count(1) as total
from pro_project_info_subdepts_users u
where u.approve_status <![CDATA[ >= ]]> 100
<if test= "comId != null " > and u.com_id = #{comId}</if>
<if test= "parId != null " > and u.par_id = #{parId}</if>
<if test= "projectId != null " > and u.project_id = #{projectId}</if>
<if test= "subDeptId != null " > and u.sub_dept_id = #{subDeptId}</if>
<if test= "subDeptType != null and subDeptType != ''" > and u.sub_dept_type = #{subDeptType}</if>
<if test= "subDeptGroup != null " > and u.sub_dept_group = #{subDeptGroup}</if>
group by u.craft_type,u.use_status
</select>
2025-01-05 14:50:38 +08:00
<update id= "updateUseStatusByParams" >
2025-01-05 17:09:13 +08:00
update pro_project_info_subdepts_users set use_status = 2
2025-01-05 14:50:38 +08:00
where 1=1
<if test= "subDeptId != null " > and sub_dept_id = #{subDeptId}</if>
2025-01-05 17:09:13 +08:00
<if test= "subDeptGroupId != null " > and sub_dept_group = #{subDeptGroupId}</if>
</update>
<update id= "editDefaultProjectById" >
2025-01-09 12:16:22 +08:00
update pro_project_info_subdepts_users set sort_by = project_id where user_id = #{userId}
2025-01-05 14:50:38 +08:00
</update>
2025-03-02 11:34:29 +08:00
<select id= "findUserPhone" resultType= "Map" >
select count(1) as total from sys_user su where (user_name = #{userPhone} or phonenumber = #{userPhone})
</select>
<update id= "updateUserPhone" >
update sys_user set user_name = #{newUserPhone}, phonenumber = #{newUserPhone} where phonenumber = #{oldUserPhone}
</update>
<update id= "updatePhone" >
update pro_project_info_subdepts_users set user_phone = #{newUserPhone} where user_phone = #{oldUserPhone}
</update>
2024-08-25 13:31:15 +08:00
</mapper>