You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocr/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/FlowableccMapper.xml

247 lines
12 KiB

<?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="cn.jyjz.xiaoyao.oa.from.dataDao.FlowableccMybatisDao">
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.oa.from.dataobject.Flowablecc">
<id column="ID" property="id" jdbcType="BIGINT"/>
<result column="USERID" property="userid" jdbcType="BIGINT"/>
<result column="FORMID" property="formid" jdbcType="BIGINT"/>
<result column="HAVEREAD" property="haveread" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="BaseResultUserMap" type="cn.jyjz.xiaoyao.oa.from.vo.UserDistionaryVo">
<id column="ID" property="id" jdbcType="BIGINT"/>
<result column="LOGINNAME" property="loginname" jdbcType="VARCHAR"/>
<result column="USERNAME" property="username" jdbcType="VARCHAR"/>
<result column="SORTING" property="sorting" jdbcType="INTEGER"/>
<result column="ENABLED" property="enabled" jdbcType="INTEGER"/>
<result column="USEX" property="usex" jdbcType="CHAR"/>
<result column="USERDESC" property="userdesc" jdbcType="VARCHAR"/>
<result column="MOBILE" property="mobile" jdbcType="VARCHAR"/>
<result column="EMAIL" property="email" jdbcType="VARCHAR"/>
<result column="USERICON" property="usericon" jdbcType="VARCHAR"/>
<result column="USERTYPE" property="usertype" jdbcType="INTEGER"/>
<result column="PERFECT" property="perfect" jdbcType="INTEGER"/>
<result column="FROMSIT" property="fromsit" jdbcType="BIGINT"/>
<result column="CREATEUSER" property="createuser" jdbcType="VARCHAR"/>
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<result column="PSDUPDATETIME" property="psdupdatetime" jdbcType="BIGINT"/>
<result column="USERDISTIONARYID" property="userdistionaryid" jdbcType="BIGINT"/>
<result column="userOsudType" property="userOsudType" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="resultMap" type="cn.jyjz.xiaoyao.oa.from.vo.RepeatedContentVo">
<id column="id" property="id"/>
<result column="content" property="content"/>
<result column="count" property="count"/>
<result column="imgUrl" property="imgUrl"/>
<collection property="repeatedTaskList" ofType="cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo">
<result column="taskId" property="taskId"/>
<result column="taskName" property="taskName"/>
<result column="nodeName" property="nodeName"/>
<result column="states" property="states"/>
<result column="similarityScore" property="similarityScore"/>
<result column="fromTime" property="fromTime"/>
<result column="updateTime" property="updateTime"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
ID AS formid,
BUESSINESSNO AS buessinessno,
USERID AS userid,
USERNAME AS username,
CATEGORYID AS categoryid,
CATEGORY AS category,
FILEANNEX AS fileannex,
GUIDANG AS guidang,
STATES AS states,
DEPLOYMENTID AS deploymentid,
ASSIGNEENAME AS assigneename,
ASSIGNEE AS assignee,
CREATEUSER AS createuser,
CREATEDATE AS createdate,
PROCESSDEFINITIONID AS processdefinitionid,
PROCESSINSTANCEID AS processinstanceid,
CREATEUSERNAME AS createusername,
TENANTID AS tenantid,
TASKNAME AS TASKNAME,
NODENAME AS NODENAME,
PACKAGEID as packageid
</sql>
<sql id="Base_Column_List_union">
flowablecc.ID AS formid,
flowablecc.BUESSINESSNO AS buessinessno,
flowablecc.USERID AS userid,
flowablecc.USERNAME AS username,
flowablecc.CATEGORYID AS categoryid,
flowablecc.CATEGORY AS category,
flowablecc.FILEANNEX AS fileannex,
flowablecc.GUIDANG AS guidang,
flowablecc.STATES AS states,
flowablecc.DEPLOYMENTID AS deploymentid,
flowablecc.ASSIGNEENAME AS assigneename,
flowablecc.ASSIGNEE AS assignee,
flowablecc.CREATEUSER AS createuser,
flowablecc.CREATEDATE AS createdate,
flowablecc.PROCESSDEFINITIONID AS processdefinitionid,
flowablecc.PROCESSINSTANCEID AS processinstanceid,
flowablecc.CREATEUSERNAME AS createusername
flowablecc.PACKAGEID as packageid
</sql>
<sql id="Base_Where">
<where>
<trim prefixOverrides="and|or">
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
<if test="formid != null"> and FORMID ${formid.dataOp} ${formid.likestar}#{formid.value}${formid.likeend}</if>
<if test="haveread != null"> and HAVEREAD ${haveread.dataOp} ${haveread.likestar}#{haveread.value}${haveread.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null">
and DEPARTID in
<foreach collection="listdept.value" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</trim>
</where>
<if test="page != null">
<if test="page.sortname != null"> order by ${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</sql>
<sql id="Base_Where_union">
<where>
<trim prefixOverrides="and|or">
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
<if test="buessinessno != null"> and BUESSINESSNO ${buessinessno.dataOp} ${buessinessno.likestar}#{buessinessno.value}${buessinessno.likeend}</if>
<if test="username != null"> and USERNAME ${username.dataOp} ${username.likestar}#{username.value}${username.likeend}</if>
<if test="categoryid != null"> and CATEGORYID ${categoryid.dataOp} ${categoryid.likestar}#{categoryid.value}${categoryid.likeend}</if>
<if test="category != null"> and CATEGORY ${category.dataOp} ${category.likestar}#{category.value}${category.likeend}</if>
<if test="fileannex != null"> and FILEANNEX ${fileannex.dataOp} ${fileannex.likestar}#{fileannex.value}${fileannex.likeend}</if>
<if test="guidang != null"> and GUIDANG ${guidang.dataOp} ${guidang.likestar}#{guidang.value}${guidang.likeend}</if>
<if test="states != null"> and STATES ${states.dataOp} ${states.likestar}#{states.value}${states.likeend}</if>
<if test="deploymentid != null"> and DEPLOYMENTID ${deploymentid.dataOp} ${deploymentid.likestar}#{deploymentid.value}${deploymentid.likeend}</if>
<if test="assigneename != null"> and ASSIGNEENAME ${assigneename.dataOp} ${assigneename.likestar}#{assigneename.value}${assigneename.likeend}</if>
<if test="assignee != null"> and find_in_set(#{assignee.value},ASSIGNEE) </if>
<if test="createusername != null"> and CREATEUSERNAME ${createusername.dataOp} ${createusername.likestar}#{createusername.value}${createusername.likeend}</if>
<if test="createuser != null"> and CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend}</if>
<if test="createdate != null"> and CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="tenantid != null"> and TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend}</if>
<if test="packageid != null"> and PACKAGEID ${packageid.dataOp} ${packageid.likestar}#{packageid.value}${packageid.likeend}</if>
<if test="processdefinitionid != null"> and PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}</if>
<if test="taskid != null"> and TASKID ${taskid.dataOp} ${taskid.likestar}#{taskid.value}${taskid.likeend}</if>
<if test="fromprojectid != null"> and FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar}#{fromprojectid.value}${fromprojectid.likeend}</if>
<if test="fromuserid != null"> and FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar}#{fromuserid.value}${fromuserid.likeend}</if>
<if test="fromplanid != null"> and FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar}#{fromplanid.value}${fromplanid.likeend}</if>
<if test="iztrueorfalse != null"> and IZTRUEORFALSE ${iztrueorfalse.dataOp} ${iztrueorfalse.likestar}#{iztrueorfalse.value}${iztrueorfalse.likeend}</if>
<if test="taskname != null"> and TASKNAME ${taskname.dataOp} ${taskname.likestar}#{taskname.value}${taskname.likeend}</if>
<if test="listFlowCcUserid != null">
and ID in
<foreach collection="listFlowCcUserid.value" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
<if test="approveUserid != null">
and ID in (
select uapo.FORMID from OA_USERAPPROVE_T uapo where uapo.USERID = #{approveUserid.value}
)
</if>
<if test="formid != null">
or ID in
<foreach collection="formid.value" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</trim>
</where>
</sql>
<select id="selectUserByFromid" resultMap="BaseResultUserMap" >
select
u.ID AS id,
u.LOGINNAME AS loginname,
u.USERNAME AS username,
u.SORTING AS sorting,
u.ENABLED AS enabled,
u.USEX AS usex,
u.USERDESC AS userdesc,
u.MOBILE AS mobile,
u.EMAIL AS email,
u.USERICON AS usericon,
u.USERTYPE AS usertype,
u.PERFECT AS perfect,
u.FROMSIT AS fromsit,
u.CREATEUSER AS createuser,
u.CREATEDATE AS createdate,
u.UPDATEUSER AS updateuser,
u.UPDATETIME AS updatetime,
u.PSDUPDATETIME AS psdupdatetime
from S_USER_T u
where u.ID in (
select uo.USERID from OA_FLOWABLECC_T uo where uo.USERID = u.ID and uo.FORMID = #{formid}
)
</select>
<select id="listMyCc" resultType="cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo" parameterType="java.util.Map">
select
<include refid="Base_Column_List"></include>
from OA_SUMMARY_VIEW
<include refid="Base_Where_union"></include>
<if test="page != null">
<if test="page.sortname != null"> order by ${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</select>
<select id="listMyCcCount" resultType="java.lang.Long" parameterType="java.util.Map">
select
count(ID)
from OA_SUMMARY_VIEW
<include refid="Base_Where_union"></include>
</select>
<select id="repetitionTask" resultMap="resultMap">
SELECT t1.count,
t1.content,
t1.id,
t1.imgUrl,
t3.similarity_score similarityScore,
t2.STATES,
t3.remark fromTaskId,
t3.taskName,
t2.TASKNAME nodeName,
t2.FROMUPTIME fromTime,
t2.UPDATETIME updateTime,
t2.TASKID taskId,
t2.ID formId
from (select count(field8) count, field8 content, ID id, imgUrl
FROM ocr_picture
where ID in (select child.PICTUREID from oa_userfinal_t final left join ocr_taskchild_picture child on final.FORMID = child.ID)
GROUP BY field8
HAVING count(field8) > 1) t1
LEFT JOIN ocr_taskchild_picture t2 ON t1.ID = t2.PICTUREID
LEFT JOIN ocr_picture t3 on t1.content = t3.field8
</select>
<select id="repetitionTaskList" resultType="cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo">
SELECT
t1.content,
t1.id,
t1.imgUrl,
t3.similarity_score similarityScore,
t2.STATES,
t3.remark fromTaskId,
t3.taskName,
t2.TASKNAME nodeName,
t2.FROMUPTIME fromTime,
t2.UPDATETIME updateTime,
t2.TASKID taskId,
t2.ID formId
from (select field8 content, ID id, imgUrl
FROM ocr_picture
where ID in (select child.PICTUREID from oa_userfinal_t final left join ocr_taskchild_picture child on final.FORMID = child.ID)
GROUP BY field8
HAVING count(field8) > 1) t1
LEFT JOIN ocr_taskchild_picture t2 ON t1.ID = t2.PICTUREID
LEFT JOIN ocr_picture t3 on t1.content = t3.field8
</select>
</mapper>