176yunxuan 21eed05bcc
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good
查询bug
2024-03-17 09:56:40 +08:00

157 lines
5.9 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.ProjectMapper">
<update id="projectEdit">
update organize_oa.oa_project
<set>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="description != null and description != ''">
description = #{description},
</if>
<if test="principalId != null and principalId != ''">
principal_id = #{principalId},
</if>
<if test="tags != null and tags != ''">
tags = #{tags},
</if>
<if test="cycle != null and cycle != ''">
cycle = #{cycle},
</if>
<if test="file != null and file != ''">
file = #{file},
</if>
<if test="beginTime != null and beginTime != ''">
begin_time = #{beginTime},
</if>
<if test="completeTime != null and completeTime != ''">
complete_time = #{completeTime},
</if>
<if test="deadline != null and deadline != ''">
deadline = #{deadline},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="isFinish != null">
is_finish = #{isFinish},
</if>
<if test="isDelete != null">
is_delete = #{isDelete},
</if>
</set>
where id = #{id}
</update>
<select id="getByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
<if test="tags != null">
select * from organize_oa.oa_project where is_delete=false and principal_id=#{userId} and status=1 and
<if test="isFinish != null and isFinish.size() > 0">
is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=") and">
#{Finish}
</foreach>
</if>
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="(json_extract(tags,'$.tags')like concat('%',"
close=",'%'))">
#{tag}
</foreach>
</if>
</select>
<select id="getByIsfinish" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false and principal_id =#{userId} and status=1 and is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=")">
#{Finish}
</foreach>
</select>
<select id="workgetByTags" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where
<if test="is != null">
(principal_id = #{userId} and is_delete=false) or
</if>
id in(select project_id from organize_oa.oa_project_work
where is_delete=false and (principal_id=#{userId} ) and
<if test="isFinish != null and isFinish.size() > 0">
is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=") and">
#{Finish}
</foreach>
</if>
project_id in(select id from organize_oa.oa_project where
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="json_extract(tags,'$.tags')like concat('%',"
close=",'%')))">
#{tag}
</foreach>
</select>
<select id="workgetByIsfinish" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where
<if test="is != null">
(principal_id = #{userId} and is_delete=false) or
</if>
id in(select project_id from organize_oa.oa_project_work where is_delete=false and (principal_id=#{userId}) and is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close="))">
#{Finish}
</foreach>
</select>
<select id="workget" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where
<if test="is != null">
(principal_id = #{userId} and is_delete=false) or
</if>
id in(select project_id from organize_oa.oa_project_work where is_delete=false and principal_id=#{userId})
</select>
<select id="workget1" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project_work where status=1 and principal_id=#{userId}
</select>
<select id="tget" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false and status=1
<if test="id != null">
and id=#{id}
</if>
</select>
<select id="tgetBytags" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false and status=1 and
<if test="isFinish != null and isFinish.size() > 0">
is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=") and">
#{Finish}
</foreach>
</if>
<foreach collection="tags" item="tag" separator=",'%') or json_extract(tags,'$.tags')like concat('%',"
open="(json_extract(tags,'$.tags')like concat('%',"
close=",'%'))">
#{tag}
</foreach>
</select>
<select id="tgetByIsfinish" resultType="com.jsl.oa.model.doData.ProjectDO">
select * from organize_oa.oa_project where is_delete=false and status=1 and is_finish in
<foreach collection="isFinish" item="Finish" separator="," open="(" close=")">
#{Finish}
</foreach>
</select>
</mapper>