<?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.ruili.wcp.dao.config.FlowCategoryRelationMapper">
|
<!-- 带流程分类、流程名称返回结果 -->
|
<resultMap id="WithFlowResultMap" type="com.ruili.wcp.data.vo.config.FlowCategoryFlowDefinitionVO">
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
<result column="flow_category_id" property="flowCategoryId"/>
|
<result column="flow_category_name" property="flowCategoryName"/>
|
<result column="flow_id" property="flowId"/>
|
<result column="flow_name" property="flowName"/>
|
<result column="flow_state" property="flowState"/>
|
</resultMap>
|
|
<resultMap id="FlowRelationMap" type="com.ruili.wcp.data.entity.config.FlowCategoryRelation">
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
<result column="flow_category_id" property="flowCategoryId"/>
|
<result column="flow_id" property="flowId"/>
|
</resultMap>
|
|
<resultMap id="flowDefinition" type="com.ruili.wcp.data.vo.management.FlowDefinitionVO">
|
<id column="flow_id" jdbcType="BIGINT" property="flowId"/>
|
<result column="flow_name" property="flowName"/>
|
<result column="module_id" property="moduleId"/>
|
<result column="form_id" property="formId"/>
|
<result column="flow_state" property="flowState"/>
|
<result column="flow_type" property="flowType"/>
|
<result column="enable_permission" property="enablePermission"/>
|
<result column="permission_name" property="permissionName"/>
|
</resultMap>
|
<sql id="Base_Column_List">
|
id, flow_category_id, flow_id
|
</sql>
|
|
|
<!-- 查询关联流程信息字段 -->
|
<sql id="WithFlow_Column_List">
|
a.id,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name
|
</sql>
|
|
<!-- 查询带流程SQL -->
|
<select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap">
|
select
|
a.id,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
|
<if test="keyWord!=null">
|
AND c.flow_name like concat('%',#{keyWord},'%')
|
</if>
|
order by a.sort_num asc
|
limit #{currIndex} , #{pageSize}
|
</select>
|
|
<!-- 查询带流程SQL -->
|
<select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap" databaseId="oracle">
|
select * from (
|
select rownum as rn,
|
a.id,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
|
<if test="keyWord!=null">
|
AND c.flow_name like '%' || '${keyWord}' || '%'
|
</if>
|
order by a.sort_num asc
|
) tt where rn between ${currIndex} and (${currIndex} + ${pageSize})
|
</select>
|
|
<!-- 查询带流程SQL -->
|
<select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap" databaseId="kingbasees">
|
select * from (
|
select rownum as rn,
|
a.id,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
|
<if test="keyWord!=null">
|
AND c.flow_name like '%' || '${keyWord}' || '%'
|
</if>
|
order by a.sort_num asc
|
) tt where rn between ${currIndex} and (${currIndex} + ${pageSize})
|
</select>
|
|
<!-- 查询带流程SQL -->
|
<select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap" databaseId="sqlServer">
|
select * from (
|
select ROW_NUMBER() OVER(
|
order by a.sort_num asc
|
) AS rn,
|
a.id,,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
|
<if test="keyWord!=null">
|
AND c.flow_name like '%' || '${keyWord}' || '%'
|
</if>
|
) tt where rn between ${currIndex} and (${currIndex} + ${pageSize})
|
</select>
|
|
<!-- 查询带流程总数量SQL -->
|
<select id="selectCountWithFlow" parameterType="map" resultType="Integer">
|
select
|
count(1)
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
<if test="keyWord!=null">
|
AND c.flow_name like concat('%',#{keyWord},'%')
|
</if>
|
</select>
|
|
<!-- 查询带流程总数量SQL -->
|
<select id="selectCountWithFlow" parameterType="map" resultType="Integer" databaseId="oracle">
|
select
|
count(1)
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
<if test="keyWord!=null">
|
AND c.flow_name like '%' || #{keyWord} || '%'
|
</if>
|
</select>
|
|
<!-- 查询带流程总数量SQL -->
|
<select id="selectCountWithFlow" parameterType="map" resultType="Integer" databaseId="kingbasees">
|
select
|
count(1)
|
from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
|
WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
|
<if test="keyWord!=null">
|
AND c.flow_name like '%' || #{keyWord} || '%'
|
</if>
|
</select>
|
|
<!-- 查询带流程SQL -->
|
<select id="selectFlowRelaion" resultMap="FlowRelationMap">
|
select id,
|
flow_category_id,
|
flow_id
|
from cnf_flow_category_relation
|
</select>
|
|
<!-- 根据分类id查询流程 -->
|
<select id="getFlowDefinitionByCategoryId" parameterType="Long" resultMap="flowDefinition">
|
select c.flow_id,
|
c.flow_name,
|
c.flow_state,
|
c.module_id,
|
c.form_id,
|
c.flow_type,
|
c.enable_permission,
|
c.permission_name,
|
c.flow_icon,
|
c.flow_css
|
from cnf_flow_category_relation a,
|
cnf_flow_category b,
|
cnf_flow_definition c
|
WHERE a.flow_category_id = b.flow_category_id
|
and a.flow_id = c.flow_id
|
and b.flow_category_id = #{flowCategoryId}
|
and c.flow_state = 1
|
order by a.sort_num asc
|
|
</select>
|
</mapper>
|