<?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="org.jeecg.modules.weekly.mapper.WekRecordMapper">
|
<insert id="insertBatch">
|
INSERT INTO wek_record
|
( id,xq, xm,wbs,gzms,gzjd,gzgs,week,ksrq,jsrq,type,plan,create_by,create_time,update_by,update_time)
|
VALUES
|
<foreach collection="wekRecords" item="wek" separator=",">
|
(#{wek.id},
|
#{wek.xq},#{wek.xm},#{wek.wbs},#{wek.gzms},#{wek.gzjd},#{wek.gzgs},#{wek.week},#{wek.ksrq},#{wek.jsrq},
|
#{wek.type},#{wek.plan},#{wek.createBy},#{wek.createTime},#{wek.updateBy},#{wek.updateTime})
|
</foreach>
|
</insert>
|
|
|
<select id="queryYearWeekGroup" resultType="java.util.HashMap">
|
SELECT `year`,week from wek_record where 1 = 1
|
<if test="user!=null and user!=''">
|
and user = #{user}
|
</if>
|
<if test="xm!=null and xm!=''">
|
and xm = #{xm}
|
</if>
|
<if test="type!=null and type!=''">
|
and type = #{type}
|
</if>
|
GROUP BY `year`,week ORDER BY `year` desc ,week desc
|
|
</select>
|
|
|
<select id="queryAllXmYearWeekGroup" resultType="java.util.HashMap">
|
SELECT `year`, week
|
from wek_record
|
where 1 = 1
|
and type = 0
|
and xm is not null
|
GROUP BY `year`, week
|
ORDER BY `year` desc, week desc
|
|
</select>
|
|
|
<select id="queryDepartUsers" resultType="java.lang.String">
|
select a.username from sys_user a
|
join sys_user_depart b on b.user_id = a.id join sys_depart c on b.dep_id = c.id where 1 = 1
|
|
|
<if test="orgCode!=null and orgCode!=''">
|
and c.org_code like '${orgCode}%'
|
</if>
|
|
|
</select>
|
|
<select id="queryProjectList" resultType="org.jeecg.modules.weekly.entity.ProProject">
|
SELECT * from pro_project WHERE 1 = 1
|
|
<if test="xmmc!=null and xmmc!=''">
|
and xmmc like '%${xmmc}%'
|
</if>
|
|
<if test="xmbh!=null and xmbh!=''">
|
and xmbh like '%${xmbh}%'
|
</if>
|
|
|
</select>
|
|
|
<select id="statisticsList" resultType="org.jeecg.modules.weekly.entity.WekRecord">
|
SELECT * from wek_record WHERE 1 = 1 and type in (0,1)
|
|
|
<if test="xm!=null and xm!=''">
|
and xm in
|
<foreach item="item" index="index" collection="xm.split(',')" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
|
<if test="user!=null and user!=''">
|
and user in
|
<foreach item="item" index="index" collection="user.split(',')" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
|
</if>
|
|
<if test="sweek!=null and sweek!=''">
|
and year_week >= (${syear}*100 + ${sweek})
|
|
</if>
|
|
<if test="eweek!=null and eweek!=''">
|
and year_week <= (${eyear}*100 + ${eweek})
|
</if>
|
|
|
</select>
|
|
|
<select id="queryUserInfoByName" resultType="java.util.HashMap">
|
SELECT a.realname ,a.post,c.depart_name departname from sys_user a
|
join sys_user_depart b on a.id = b.user_id
|
join sys_depart c on b.dep_id = c.id
|
WHERE a.username = #{user}
|
</select>
|
|
|
<select id="queryUsersInfoByNames" resultType="java.util.HashMap">
|
SELECT a.username,a.realname ,a.post,c.depart_name departname from sys_user a
|
join sys_user_depart b on a.id = b.user_id
|
join sys_depart c on b.dep_id = c.id
|
WHERE 1 = 1 and a.username in
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</select>
|
|
|
|
</mapper>
|