81 lines
3.2 KiB
XML
81 lines
3.2 KiB
XML
<?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.jsl.oa.mapper.ProjectDailyMapper">
|
|
|
|
<!-- 插入方法的 SQL 语句 -->
|
|
<insert id="insert" parameterType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
insert into organize_oa.oa_project_daily
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="content != null">content,</if>
|
|
<if test="dailyTime != null">daily_time,</if>
|
|
created_at
|
|
</trim>
|
|
values
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="content != null">#{content},</if>
|
|
<if test="dailyTime != null">#{dailyTime},</if>
|
|
NOW()
|
|
</trim>
|
|
</insert>
|
|
|
|
<select id="getProjectDailyByUser" parameterType="java.lang.Long"
|
|
resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
select * from organize_oa.oa_project_daily where user_id = #{uid}
|
|
and is_delete = 0
|
|
</select>
|
|
|
|
<select id="getProjectDailyByProject" parameterType="java.lang.Long"
|
|
resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
select * from organize_oa.oa_project_daily where project_id = #{pid}
|
|
and is_delete = 0
|
|
</select>
|
|
|
|
<select id="getProjectDailyByProjectAndTime" parameterType="java.util.Map"
|
|
resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
select * from organize_oa.oa_project_daily
|
|
where project_id = #{id}
|
|
and created_at between #{beginTime} and #{endTime}
|
|
and is_delete = 0
|
|
</select>
|
|
|
|
<select id="getProjectDailyByUserAndTime" parameterType="java.util.Map"
|
|
resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
select * from organize_oa.oa_project_daily
|
|
where user_id = #{userId}
|
|
and created_at between #{beginTime} and #{endTime}
|
|
and is_delete = 0
|
|
</select>
|
|
|
|
|
|
<select id="getDailyById" parameterType="java.lang.Integer" resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
select * from organize_oa.oa_project_daily
|
|
where id = #{id} and is_delete = 0
|
|
</select>
|
|
|
|
<delete id="deleteDailyById" parameterType="java.lang.Integer">
|
|
UPDATE organize_oa.oa_project_daily
|
|
SET is_delete = 1
|
|
WHERE id = #{id}
|
|
</delete>
|
|
|
|
<update id="updateDaily" parameterType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
UPDATE organize_oa.oa_project_daily
|
|
<set>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
<if test="content != null">content = #{content},</if>
|
|
<if test="dailyTime != null">daily_time = #{dailyTime},</if>
|
|
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
|
<if test="isDelete != null">is_delete = #{isDelete}</if>
|
|
</set>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
</mapper> |