ganzi-api/inventory-dao/src/main/resources/mapper/OADistributionMapper.xml

281 lines
11 KiB
XML
Raw Normal View History

2022-09-16 15:07:17 +08:00
<?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.rzyc.mapper.OADistributionMapper">
<resultMap id="BaseResultMap" type="com.rzyc.model.OADistribution">
<id column="OADistributionId" jdbcType="VARCHAR" property="oadistributionid" />
<result column="OATaskId" jdbcType="VARCHAR" property="oataskid" />
<result column="SysUserId" jdbcType="VARCHAR" property="sysuserid" />
<result column="SysChinaName" jdbcType="VARCHAR" property="syschinaname" />
<result column="SysTelephone" jdbcType="VARCHAR" property="systelephone" />
<result column="AppStatus" jdbcType="VARCHAR" property="appstatus" />
2022-09-23 09:51:31 +08:00
<result column="AppStatus" jdbcType="VARCHAR" property="appstatus" />
2022-09-16 15:07:17 +08:00
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
</resultMap>
2022-09-20 14:54:58 +08:00
2022-09-16 15:07:17 +08:00
<sql id="Base_Column_List">
2022-09-20 14:54:58 +08:00
OADistributionId, OATaskId,sned_id, SysUserId, SysChinaName, SysTelephone, title,
subject,start_time,end_time,AppStatus, CreatedOn,
2022-09-16 15:07:17 +08:00
CreatedBy, ModifiedOn, ModifiedBy
</sql>
2022-09-20 14:54:58 +08:00
2022-09-16 15:07:17 +08:00
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from OADistribution
where OADistributionId = #{oadistributionid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from OADistribution
where OADistributionId = #{oadistributionid,jdbcType=VARCHAR}
</delete>
2022-09-20 14:54:58 +08:00
2022-10-27 17:24:20 +08:00
<insert id="insertOAdistribution" parameterType="com.rzyc.model.OADistribution">
insert into OADistribution (OADistributionId, OATaskId, sned_id,SysUserId,
2022-10-20 17:29:33 +08:00
SysChinaName, SysTelephone, AppStatus,title,subject,start_time,end_time,
2022-09-16 15:07:17 +08:00
CreatedOn, CreatedBy, ModifiedOn,
ModifiedBy)
2022-10-27 17:24:20 +08:00
values (#{oadistributionid,jdbcType=VARCHAR}, #{oataskid,jdbcType=VARCHAR}, #{snedId},#{sysuserid,jdbcType=VARCHAR},
2022-10-20 17:29:33 +08:00
#{syschinaname,jdbcType=VARCHAR}, #{systelephone,jdbcType=VARCHAR}, #{appstatus,jdbcType=VARCHAR},#{title},#{subject},#{startTime},#{endTime},
2022-09-16 15:07:17 +08:00
#{createdon,jdbcType=TIMESTAMP}, #{createdby,jdbcType=VARCHAR}, #{modifiedon,jdbcType=TIMESTAMP},
#{modifiedby,jdbcType=VARCHAR})
</insert>
2022-10-20 17:29:33 +08:00
2022-09-16 15:07:17 +08:00
<insert id="insertSelective" parameterType="com.rzyc.model.OADistribution">
insert into OADistribution
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="oadistributionid != null">
OADistributionId,
</if>
<if test="oataskid != null">
OATaskId,
</if>
<if test="sysuserid != null">
SysUserId,
</if>
<if test="syschinaname != null">
SysChinaName,
</if>
<if test="systelephone != null">
SysTelephone,
</if>
<if test="appstatus != null">
AppStatus,
</if>
<if test="createdon != null">
CreatedOn,
</if>
<if test="createdby != null">
CreatedBy,
</if>
<if test="modifiedon != null">
ModifiedOn,
</if>
<if test="modifiedby != null">
ModifiedBy,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="oadistributionid != null">
#{oadistributionid,jdbcType=VARCHAR},
</if>
<if test="oataskid != null">
#{oataskid,jdbcType=VARCHAR},
</if>
<if test="sysuserid != null">
#{sysuserid,jdbcType=VARCHAR},
</if>
<if test="syschinaname != null">
#{syschinaname,jdbcType=VARCHAR},
</if>
<if test="systelephone != null">
#{systelephone,jdbcType=VARCHAR},
</if>
<if test="appstatus != null">
#{appstatus,jdbcType=VARCHAR},
</if>
<if test="createdon != null">
#{createdon,jdbcType=TIMESTAMP},
</if>
<if test="createdby != null">
#{createdby,jdbcType=VARCHAR},
</if>
<if test="modifiedon != null">
#{modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="modifiedby != null">
#{modifiedby,jdbcType=VARCHAR},
</if>
</trim>
</insert>
2022-09-20 14:54:58 +08:00
2022-09-16 15:07:17 +08:00
<update id="updateByPrimaryKeySelective" parameterType="com.rzyc.model.OADistribution">
update OADistribution
<set>
<if test="oataskid != null">
OATaskId = #{oataskid,jdbcType=VARCHAR},
</if>
<if test="sysuserid != null">
SysUserId = #{sysuserid,jdbcType=VARCHAR},
</if>
<if test="syschinaname != null">
SysChinaName = #{syschinaname,jdbcType=VARCHAR},
</if>
<if test="systelephone != null">
SysTelephone = #{systelephone,jdbcType=VARCHAR},
</if>
<if test="appstatus != null">
AppStatus = #{appstatus,jdbcType=VARCHAR},
</if>
<if test="createdon != null">
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
</if>
<if test="createdby != null">
CreatedBy = #{createdby,jdbcType=VARCHAR},
</if>
<if test="modifiedon != null">
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="modifiedby != null">
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
</if>
</set>
where OADistributionId = #{oadistributionid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.rzyc.model.OADistribution">
update OADistribution
set OATaskId = #{oataskid,jdbcType=VARCHAR},
SysUserId = #{sysuserid,jdbcType=VARCHAR},
SysChinaName = #{syschinaname,jdbcType=VARCHAR},
SysTelephone = #{systelephone,jdbcType=VARCHAR},
AppStatus = #{appstatus,jdbcType=VARCHAR},
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
CreatedBy = #{createdby,jdbcType=VARCHAR},
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{modifiedby,jdbcType=VARCHAR}
where OADistributionId = #{oadistributionid,jdbcType=VARCHAR}
</update>
<!--批量添加-->
<insert id="insertList" parameterType="com.rzyc.model.check.ChkGovBillDetailWithBLOBs">
insert into OADistribution (OADistributionId, OATaskId, SysUserId,
SysChinaName, SysTelephone, AppStatus,
CreatedOn, CreatedBy, ModifiedOn,
ModifiedBy)
values
<foreach collection ="records" item="record" index= "index" separator =",">
(#{record.oadistributionid,jdbcType=VARCHAR}, #{record.oataskid,jdbcType=VARCHAR},
#{record.sysuserid,jdbcType=VARCHAR},
#{record.syschinaname,jdbcType=VARCHAR}, #{record.systelephone,jdbcType=VARCHAR},
#{record.appstatus,jdbcType=VARCHAR},
#{record.createdon,jdbcType=TIMESTAMP}, #{record.createdby,jdbcType=VARCHAR},
#{record.modifiedon,jdbcType=TIMESTAMP},
#{record.modifiedby,jdbcType=VARCHAR})
</foreach>
</insert>
<resultMap id="ReceiveResultMap" type="com.rzyc.model.OADistribution">
<id column="OADistributionId" jdbcType="VARCHAR" property="oadistributionid" />
<result column="OATaskId" jdbcType="VARCHAR" property="oataskid" />
<result column="SysUserId" jdbcType="VARCHAR" property="sysuserid" />
<result column="SysChinaName" jdbcType="VARCHAR" property="syschinaname" />
<result column="receiveName" jdbcType="VARCHAR" property="receiveName" />
<result column="SysTelephone" jdbcType="VARCHAR" property="systelephone" />
<result column="AppStatus" jdbcType="VARCHAR" property="appstatus" />
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
</resultMap>
<!--任务接收人-->
<select id="receiveUser" resultMap="ReceiveResultMap">
SELECT su.`ChinaName` receiveName,ob.* FROM OADistribution ob
LEFT JOIN SysUser su ON ob.`SysUserId` = su.`SysUserId`
WHERE ob.`OATaskId` = #{taskId}
</select>
<!--任务接收部门-->
<select id="receiveUnit" resultMap="ReceiveResultMap">
SELECT lp.`PerformClassName` receiveName,ob.* FROM OADistribution ob
LEFT JOIN ListPerform lp ON ob.`SysUserId` = lp.ListPerformId
WHERE ob.`OATaskId` = #{taskId}
</select>
<!--修改读取状态-->
<update id="changeStatus">
UPDATE OADistribution SET AppStatus = "已读" WHERE OATaskId = #{taskId}
AND SysUserId = #{sysUserId}
</update>
2022-09-23 09:51:31 +08:00
<select id="deliverTaskList" resultType="com.rzyc.model.OADistribution">
select ob.* from OADistribution ob
where ob.subject like #{condition}
2022-09-26 15:20:53 +08:00
and ob.sned_id = #{snedId}
order by ob.end_time asc
</select>
2022-09-28 16:29:17 +08:00
<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
2022-09-26 15:20:53 +08:00
select ob.* from OADistribution ob
where ob.subject like #{condition}
and ob.SysUserId = #{snedId}
order by ob.end_time asc
2022-09-28 16:29:17 +08:00
</select>
2022-09-26 15:20:53 +08:00
2022-09-23 17:04:45 +08:00
2022-10-27 17:24:20 +08:00
<update id="updateDistriubtion" parameterType="com.rzyc.model.OADistribution">
update OADistribution
set OATaskId = #{oaDistribution.oataskid,jdbcType=VARCHAR},
sned_id = #{oaDistribution.snedId,jdbcType=VARCHAR},
SysUserId = #{oaDistribution.sysuserid,jdbcType=VARCHAR},
SysChinaName = #{oaDistribution.syschinaname,jdbcType=VARCHAR},
SysTelephone = #{oaDistribution.systelephone,jdbcType=VARCHAR},
title = #{oaDistribution.title},
subject = #{oaDistribution.subject},
AppStatus = #{oaDistribution.appstatus,jdbcType=VARCHAR},
CreatedOn = #{oaDistribution.createdon,jdbcType=TIMESTAMP},
CreatedBy = #{oaDistribution.createdby,jdbcType=VARCHAR},
ModifiedOn = #{oaDistribution.modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{oaDistribution.modifiedby,jdbcType=VARCHAR}
where OADistributionId = #{oaDistribution.oadistributionid}
</update>
2022-10-31 09:40:53 +08:00
<!--专项工作详情-->
<select id="singleWorkDetail" resultType="com.rzyc.bean.task.vo.SingleWorkVo">
select ot.OATaskId,ot.send_id,ot.StartDate,ot.EndDate,ot.Subject,ot.send_id,ot.AppStatus,ot.title,ot.CreatedOn
from oatask ot
join OADistribution od on ot.OATaskId = od.OATaskId
where od.OADistributionId = #{idDto.id}
</select>
<select id="selectName" resultType="com.rzyc.bean.task.vo.NameVo">
select od.SysChinaName as name
from OADistribution od
join oatask ot
on ot.OATaskId = od.OATaskId
where od.OATaskId = #{nameDto.taskId}
and ot.TaskType = #{nameDto.taskTypeId}
</select>
<insert id="deliverTask" parameterType="java.util.List">
insert into
OADistribution (OADistributionId, OATaskId, sned_id,SysUserId,
SysChinaName, SysTelephone, AppStatus,title,subject,start_time,end_time,
CreatedOn, CreatedBy, ModifiedOn,ModifiedBy)
values
<foreach collection="distributions" item="item" index="index" separator="," >
(#{item.oadistributionid}, #{item.oataskid}, #{item.snedId},#{item.sysuserid},
#{item.syschinaname}, #{item.systelephone}, #{item.appstatus},#{item.title},#{item.subject},#{item.startTime},#{item.endTime},
#{item.createdon}, #{item.createdby}, #{item.modifiedon},
#{item.modifiedby})
</foreach>
</insert>
2022-09-16 15:07:17 +08:00
</mapper>