ganzi-api/inventory-dao/src/main/resources/mapper/OADistributionMapper.xml
2022-09-26 15:20:53 +08:00

242 lines
9.1 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.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" />
<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>
<sql id="Base_Column_List">
OADistributionId, OATaskId,sned_id, SysUserId, SysChinaName, SysTelephone, title,
subject,start_time,end_time,AppStatus, CreatedOn,
CreatedBy, ModifiedOn, ModifiedBy
</sql>
<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>
<insert id="insert" parameterType="com.rzyc.model.OADistribution">
insert into OADistribution (OADistributionId, OATaskId, SysUserId,
SysChinaName, SysTelephone, AppStatus,
CreatedOn, CreatedBy, ModifiedOn,
ModifiedBy)
values (#{oadistributionid,jdbcType=VARCHAR}, #{oataskid,jdbcType=VARCHAR}, #{sysuserid,jdbcType=VARCHAR},
#{syschinaname,jdbcType=VARCHAR}, #{systelephone,jdbcType=VARCHAR}, #{appstatus,jdbcType=VARCHAR},
#{createdon,jdbcType=TIMESTAMP}, #{createdby,jdbcType=VARCHAR}, #{modifiedon,jdbcType=TIMESTAMP},
#{modifiedby,jdbcType=VARCHAR})
</insert>
<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>
<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>
<select id="deliverTaskList" resultType="com.rzyc.model.OADistribution">
select ob.* from OADistribution ob
where ob.subject like #{condition}
and ob.sned_id = #{snedId}
order by ob.end_time asc
</select>
<!--<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
select ob.* from OADistribution ob
where ob.subject like #{condition}
and ob.SysUserId = #{snedId}
order by ob.end_time asc
</select>-->
<select id="getTaskList" resultType="com.rzyc.model.OADistribution">
select ob.* from OADistribution ob
where 1=1
<if test="null != condition and condition != ''">
ob.subject like #{condition}
</if>
<if test="null != SysUserId and SysUserId != ''">
and ob.SysUserId = #{snedId}
</if>
order by ob.end_time asc
</select>
</mapper>