src/main/resources/mapper/AttendMapper.xml
(开头部分) 9KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?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.yj.oa.project.mapper.AttendMapper">
<resultMap id="BaseResultMap" type="com.yj.oa.project.po.Attend">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="userId" property="userId" jdbcType="VARCHAR" />
<result column="currDate" property="currDate" jdbcType="DATE" />
<result column="week" property="week" jdbcType="VARCHAR" />
<result column="attendMorStart" property="attendMorStart" jdbcType="TIME" />
<result column="attendMorLeave" property="attendMorLeave" jdbcType="TIME" />
<result column="attendNoonStart" property="attendNoonStart" jdbcType="TIME" />
<result column="attendNoonLeave" property="attendNoonLeave" jdbcType="TIME" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="isDel" property="isDel" jdbcType="INTEGER" />
<association property="user" javaType="User">
<result column="name" property="name"/>
</association>
<association property="dept" javaType="Dept">
<result column="deptName" property="deptName"/>
</association>
</resultMap>
<sql id="Base_Column_List">
id, userId, currDate, week, attendMorStart, attendMorLeave, attendNoonStart, attendNoonLeave,
a.status, a.isDel
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
SELECT
<include refid="Base_Column_List"/>
,u.dept,
u. NAME,
d.deptName
FROM
t_user u
RIGHT JOIN t_attend a ON a.userId = u.uid
LEFT JOIN t_dept d ON d.depId = a.deptId
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAttendList" resultMap="BaseResultMap" parameterType="java.lang.Integer">
SELECT
<include refid="Base_Column_List"/>
,u.dept,
u. NAME,
d.deptName
FROM
t_user u
RIGHT JOIN t_attend a ON a.userId = u.uid
LEFT JOIN t_dept d ON d.depId = a.deptId
<where>
<if test="userId !=null and userId !=''">
and userId in (SELECT uid from t_user WHERE name like concat('%',#{userId},'%'))
</if>
<if test="deptId !=null and deptId !=''">
and a.deptId in (SELECT depId from t_dept WHERE deptName like concat('%',#{deptId},'%'))
</if>
<if test="beginTime !=null">
<![CDATA[ and DATE_FORMAT(currDate, '%Y-%m-%d')>= DATE_FORMAT(#{beginTime}, '%Y-%m-%d') ]]>
</if>
<if test="overTime !=null">
后面还有 193 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。