<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, hnqz All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the pig4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: hnqz
  ~
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.qunzhixinxi.hnqz.daemon.quartz.mapper.WmTaskMapper">

	<resultMap id="wmTaskMap" type="com.qunzhixinxi.hnqz.daemon.quartz.entity.WmTask">
		<id property="id" column="id"/>
		<result property="taskRuleId" column="task_rule_id"/>
		<result property="score" column="score"/>
		<result property="scorePackageDrugId" column="score_package_drug_id"/>
		<result property="scorePackageLevel1Id" column="score_package_level1_id"/>
		<result property="scorePackageId" column="score_package_id"/>
		<result property="taskTypeId" column="task_type_id"/>
		<result property="lookintoDate" column="lookinto_date"/>
		<result property="province" column="province"/>
		<result property="city" column="city"/>
		<result property="area" column="area"/>
		<result property="address" column="address"/>
		<result property="lookintoTypeId" column="lookinto_type_id"/>
		<result property="taskContentId" column="task_content_id"/>
		<result property="taskStatus" column="task_status"/>
		<result property="taskUserId" column="task_user_id"/>
		<result property="taskUserType" column="task_user_type"/>
		<result property="drugEntId" column="drug_ent_id"/>
		<result property="deptId" column="dept_id"/>
		<result property="delFlag" column="del_flag"/>
		<result property="enableFlag" column="enable_flag"/>
		<result property="tenantId" column="tenant_id"/>
		<result property="createTime" column="create_time"/>
		<result property="createUser" column="create_user"/>
		<result property="updateTime" column="update_time"/>
		<result property="updateUser" column="update_user"/>
		<result property="submitStatus" column="submit_status"/>
		<result property="shareImgUrl" column="share_img_url"/>
		<result property="platAuditStatus" column="plat_audit_status"/>
		<result property="taskInfoImg" column="task_info_img"/>
	</resultMap>


	<select id="listUserInfo" resultType="map">
		SELECT u.user_id AS `userId`,
		u.username,
		u.realname,
		sd.dept_id AS `deptId`,
		sd.name AS `deptName`
		FROM sys_user u
		LEFT JOIN sys_dept sd ON u.dept_id = sd.dept_id
		<where>
			sd.name NOT IN ('上海问云生物科技有限公司', '北京遥领医疗科技有限公司')
			AND u.user_id IN
			<foreach collection="userIds" item="id" index="idx" separator="," open="(" close=")">
				#{id}
			</foreach>
		</where>

	</select>
</mapper>
