<?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.ruoyi.collaborativeApproval.mapper.DutyPlanMapper">
|
<resultMap id="DutyPlanDTOMap" type="com.ruoyi.collaborativeApproval.dto.DutyPlanDTO">
|
<result column="id" property="id"/>
|
<result column="tags" property="tags" typeHandler="com.ruoyi.approve.utils.ListToStringTypeHandler"/>
|
</resultMap>
|
|
<select id="listPage" resultMap="DutyPlanDTOMap">
|
select * from duty_plan
|
<where>
|
1=1
|
<if test="dutyPlan.title != null and dutyPlan.title != ''">
|
and title like concat('%',#{dutyPlan.title},'%')
|
</if>
|
<if test="dutyPlan.level != null">
|
and level = #{dutyPlan.level}
|
</if>
|
<if test="dutyPlan.period != null">
|
and period = #{dutyPlan.period}
|
</if>
|
<if test="dutyPlan.queryDate != null">
|
and start_date <= #{dutyPlan.queryDate}
|
and end_date >= #{dutyPlan.queryDate}
|
</if>
|
</where>
|
</select>
|
|
<select id="getNum" resultType="java.util.Map">
|
SELECT
|
level,
|
COUNT(*) AS num,
|
ROUND(COUNT(*) / total.count * 100) AS completion
|
FROM
|
duty_plan,
|
(SELECT COUNT(*) AS count FROM duty_plan) AS total
|
GROUP BY
|
level, total.count
|
</select>
|
</mapper>
|