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

353 lines
14 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" />
<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="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
OADistributionId, OATaskId, SysUserId, SysChinaName, SysTelephone, AppStatus, CreatedOn,
CreatedBy, ModifiedOn, ModifiedBy
</sql>
<select id="selectByExample" parameterType="com.rzyc.model.OADistributionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from OADistribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<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>
<delete id="deleteByExample" parameterType="com.rzyc.model.OADistributionExample">
delete from OADistribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</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>
<select id="countByExample" parameterType="com.rzyc.model.OADistributionExample" resultType="java.lang.Long">
select count(*) from OADistribution
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update OADistribution
<set>
<if test="record.oadistributionid != null">
OADistributionId = #{record.oadistributionid,jdbcType=VARCHAR},
</if>
<if test="record.oataskid != null">
OATaskId = #{record.oataskid,jdbcType=VARCHAR},
</if>
<if test="record.sysuserid != null">
SysUserId = #{record.sysuserid,jdbcType=VARCHAR},
</if>
<if test="record.syschinaname != null">
SysChinaName = #{record.syschinaname,jdbcType=VARCHAR},
</if>
<if test="record.systelephone != null">
SysTelephone = #{record.systelephone,jdbcType=VARCHAR},
</if>
<if test="record.appstatus != null">
AppStatus = #{record.appstatus,jdbcType=VARCHAR},
</if>
<if test="record.createdon != null">
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
</if>
<if test="record.createdby != null">
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
</if>
<if test="record.modifiedon != null">
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
</if>
<if test="record.modifiedby != null">
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update OADistribution
set OADistributionId = #{record.oadistributionid,jdbcType=VARCHAR},
OATaskId = #{record.oataskid,jdbcType=VARCHAR},
SysUserId = #{record.sysuserid,jdbcType=VARCHAR},
SysChinaName = #{record.syschinaname,jdbcType=VARCHAR},
SysTelephone = #{record.systelephone,jdbcType=VARCHAR},
AppStatus = #{record.appstatus,jdbcType=VARCHAR},
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<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>
</mapper>