123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <?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.qunzhixinxi.hnqz.admin.mapper.WmTaskV2Mapper">
- <resultMap id="wmTaskMap"
- type="com.qunzhixinxi.hnqz.admin.controller.task.vo.TaskRespVO$ToDirectCheck">
- <id property="taskId" column="id"/>
- <result property="taskNumber" column="task_number"/>
- <result property="taskTypeId" column="task_type_id"/>
- <result property="taskScore" column="score"/>
- <result property="taskStatus" column="task_status"/>
- <result property="createTime" column="create_time"/>
- <result property="taskUserId" column="task_user_id"/>
- <result property="taskContentId" column="task_content_id"/>
- <result property="entId" column="dept_id"/>
- <result property="pkgName" column="score_package_name"/>
- <result property="relPkgName" column="rel_pkg_name"/>
- <result property="pkgStartTime" column="start_time"/>
- <result property="pkgEndTime" column="end_time"/>
- <result property="provAbbr" column="prov_abbr"/>
- <result property="skuId" column="drugtable"/>
- <!-- <collection property="checkHistoryList" javaType="java.util.ArrayList" ofType="map"-->
- <!-- select="com.qunzhixinxi.hnqz.admin.mapper.SysCheckChainNodeCheckHistoryMapper.getTaskCheckHis"-->
- <!-- column="id"/>-->
- </resultMap>
- <select id="pageDirectCheck" resultMap="wmTaskMap">
- SELECT t.id,
- t.task_number,
- t.task_type_id,
- t.score,
- t.task_user_id,
- t.task_status,
- t.create_time,
- t.task_content_id,
- pkg.dept_id,
- pkg.score_package_name,
- ppkg.score_package_name AS rel_pkg_name,
- pkg.start_time,
- pkg.end_time,
- ppkg.prov_abbr,
- pkg.drugtable
- FROM wm_task AS t
- LEFT JOIN wm_score_package AS pkg ON pkg.id = t.score_package_id
- LEFT JOIN wm_score_package AS ppkg ON ppkg.id = pkg.relation_score_id
- INNER JOIN (SELECT DISTINCT tmp.target_id AS task_id
- FROM (SELECT h.target_id, SUM(DISTINCT h.node_id) AS node_sum
- FROM sys_chain_node_check_his AS h
- GROUP BY h.target_id) tmp
- WHERE tmp.node_sum IN
- <foreach collection="nodeIds" item="nodeId" open="(" close=")" separator=",">
- #{nodeId}
- </foreach>
- ORDER BY task_id) AS his
- ON his.task_id = t.id
- <where>
- t.del_flag = '0'
- AND pkg.enable_flag = '0'
- AND pkg.del_flag = '0'
- AND ppkg.enable_flag = '0'
- AND ppkg.del_flag = '0'
- <if test="pkgIssueDate != null and pkgExpiryDate != null">
- AND
- (pkg.start_time >= #{pkgIssueDate} AND pkg.start_time <= #{pkgExpiryDate}
- OR pkg.end_time >= #{pkgIssueDate} AND pkg.end_time <= #{pkgExpiryDate})
- </if>
- <if test="prov != null and prov != ''">
- AND ppkg.prov_abbr = #{prov}
- </if>
- <if test="vendorIds != null and vendorIds.size > 0">
- AND pkg.dept_id IN
- <foreach collection="vendorIds" item="vid" open="(" close=")" separator=",">
- #{vid}
- </foreach>
- </if>
- <if test="skuIds != null and skuIds.size > 0">
- AND pkg.drugtable IN
- <foreach collection="skuIds" item="skuId" open="(" close=")" separator=",">
- #{skuId}
- </foreach>
- </if>
- <if test="pkgIds != null and pkgIds.size > 0">
- AND t.score_package_id IN
- <foreach collection="pkgIds" item="pid" open="(" close=")" separator=",">
- #{pid}
- </foreach>
- </if>
- <if test="taskTypeId != null and taskTypeId != ''">
- AND t.task_type_id = #{taskTypeId}
- </if>
- <if test="salesId != null">
- AND t.task_user_id = #{salesId}
- </if>
- <if test="taskStatus != null and taskStatus != ''">
- AND t.task_status = #{taskStatus}
- </if>
- <if test="taskStartTime != null and taskEndTime != null">
- AND (t.create_time BETWEEN #{taskStartTime} AND #{taskEndTime})
- </if>
- </where>
- ORDER BY t.id
- </select>
- <select id="pageDirectChecked" resultMap="wmTaskMap">
- SELECT t.id,
- t.task_number,
- t.task_type_id,
- t.score,
- t.task_user_id,
- t.task_status,
- t.create_time,
- t.task_content_id,
- pkg.dept_id,
- pkg.score_package_name,
- ppkg.score_package_name AS rel_pkg_name,
- pkg.start_time,
- pkg.end_time,
- ppkg.prov_abbr,
- pkg.drugtable
- FROM wm_task AS t
- LEFT JOIN wm_score_package AS pkg ON pkg.id = t.score_package_id
- LEFT JOIN wm_score_package AS ppkg ON ppkg.id = pkg.relation_score_id
- <where>
- <if test="taskIds != null and taskIds.size > 0">
- t.id IN
- <foreach collection="taskIds" item="tid" open="(" close=")" separator=",">
- #{tid}
- </foreach>
- </if>
- <if test="pkgIssueDate != null and pkgExpiryDate != null">
- AND
- (pkg.start_time >= #{pkgIssueDate} AND pkg.start_time <= #{pkgExpiryDate}
- OR pkg.end_time >= #{pkgIssueDate} AND pkg.end_time <= #{pkgExpiryDate})
- </if>
- <if test="prov != null and prov != ''">
- AND ppkg.prov_abbr = #{prov}
- </if>
- <if test="vendorIds != null and vendorIds.size > 0">
- AND pkg.dept_id IN
- <foreach collection="vendorIds" item="vid" open="(" close=")" separator=",">
- #{vid}
- </foreach>
- </if>
- <if test="skuIds != null and skuIds.size > 0">
- AND pkg.drugtable IN
- <foreach collection="skuIds" item="skuId" open="(" close=")" separator=",">
- #{skuId}
- </foreach>
- </if>
- <if test="pkgIds != null and pkgIds.size > 0">
- AND t.score_package_id IN
- <foreach collection="pkgIds" item="pid" open="(" close=")" separator=",">
- #{pid}
- </foreach>
- </if>
- <if test="taskTypeId != null and taskTypeId != ''">
- AND t.task_type_id = #{taskTypeId}
- </if>
- <if test="salesId != null">
- AND t.task_user_id = #{salesId}
- </if>
- <if test="taskStartTime != null and taskEndTime != null">
- AND (t.create_time BETWEEN #{taskStartTime} AND #{taskEndTime})
- </if>
- <if test="taskStatus != null and taskStatus != ''">
- AND t.task_status = #{taskStatus}
- </if>
- </where>
- ORDER BY t.id
- </select>
- </mapper>
|