<?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">
|
<!--
|
* @title: 业务流程节点表
|
* @description: 自定义sql,请自行实现业务逻辑
|
* @company: hugeinfo
|
* @author: liyj
|
* @time:2024-09-08 15:09:08
|
* @version 1.0.0
|
-->
|
<mapper namespace="cn.huge.module.flow.dao.mapper.FlowNodeMapper">
|
<!-- 结果集 -->
|
<resultMap id="dataResult" type="cn.huge.module.flow.domain.po.FlowNode">
|
<result property="id" column="id"/>
|
<result property="flowId" column="flow_id"/>
|
<result property="flowableId" column="flowable_id"/>
|
<result property="nodeId" column="node_id"/>
|
<result property="nodeShowName" column="node_show_name"/>
|
<result property="nodeName" column="node_name"/>
|
<result property="nodeType" column="node_type"/>
|
<result property="nodeIndex" column="node_index"/>
|
<result property="nodeIcon" column="node_icon"/>
|
<result property="apiType" column="api_type"/>
|
<result property="api" column="api"/>
|
<result property="caseProcess" column="case_process"/>
|
<result property="caseProcessName" column="case_process_name"/>
|
<result property="expire" column="expire"/>
|
<result property="candeType" column="cande_type"/>
|
<result property="candeUnitId" column="cande_unit_id"/>
|
<result property="candeUnitName" column="cande_unit_name"/>
|
<result property="candeDeptId" column="cande_dept_id"/>
|
<result property="candeDeptName" column="cande_dept_name"/>
|
<result property="candeRoleCode" column="cande_role_code"/>
|
<result property="candeRoleName" column="cande_role_name"/>
|
<result property="candeUserId" column="cande_user_id"/>
|
<result property="candeUserName" column="cande_user_name"/>
|
<result property="goCond" column="go_cond"/>
|
<result property="backCond" column="back_cond"/>
|
<result property="des" column="des"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="custId" column="cust_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
</resultMap>
|
<!-- 表 -->
|
<sql id='table-name'>dyh_flow_node</sql>
|
<!-- 字段 -->
|
<sql id="column-part">
|
id,
|
flow_id,
|
flowable_id,
|
node_id,
|
node_show_name,
|
node_name,
|
node_type,
|
node_index,
|
node_icon,
|
api_type,
|
api,
|
case_process,
|
case_process_name,
|
expire,
|
cande_type,
|
cande_unit_id,
|
cande_unit_name,
|
cande_dept_id,
|
cande_dept_name,
|
cande_role_code,
|
cande_role_name,
|
cande_user_id,
|
cande_user_name,
|
go_cond,
|
back_cond,
|
des,
|
delete_status,
|
cust_id,
|
create_time,
|
update_time
|
</sql>
|
<!-- 更新实体字段 -->
|
<sql id="set-part">
|
<if test="entity.flowId != null">flow_id = #{entity.flowId},</if>
|
<if test="entity.flowableId != null">flowable_id = #{entity.flowableId},</if>
|
<if test="entity.nodeId != null">node_id = #{entity.nodeId},</if>
|
<if test="entity.nodeShowName != null">node_show_name = #{entity.nodeShowName},</if>
|
<if test="entity.nodeName != null">node_name = #{entity.nodeName},</if>
|
<if test="entity.nodeType != null">node_type = #{entity.nodeType},</if>
|
<if test="entity.nodeIndex != null">node_index = #{entity.nodeIndex},</if>
|
<if test="entity.nodeIcon != null">node_icon = #{entity.nodeIcon},</if>
|
<if test="entity.apiType != null">api_type = #{entity.apiType},</if>
|
<if test="entity.api != null">api = #{entity.api},</if>
|
<if test="entity.caseProcess != null">case_process = #{entity.caseProcess},</if>
|
<if test="entity.caseProcessName != null">case_process_name = #{entity.caseProcessName},</if>
|
<if test="entity.expire != null">expire = #{entity.expire},</if>
|
<if test="entity.candeType != null">cande_type = #{entity.candeType},</if>
|
<if test="entity.candeUnitId != null">cande_unit_id = #{entity.candeUnitId},</if>
|
<if test="entity.candeUnitName != null">cande_unit_name = #{entity.candeUnitName},</if>
|
<if test="entity.candeDeptId != null">cande_dept_id = #{entity.candeDeptId},</if>
|
<if test="entity.candeDeptName != null">cande_dept_name = #{entity.candeDeptName},</if>
|
<if test="entity.candeRoleCode != null">cande_role_code = #{entity.candeRoleCode},</if>
|
<if test="entity.candeRoleName != null">cande_role_name = #{entity.candeRoleName},</if>
|
<if test="entity.candeUserId != null">cande_user_id = #{entity.candeUserId},</if>
|
<if test="entity.candeUserName != null">cande_user_name = #{entity.candeUserName},</if>
|
<if test="entity.goCond != null">go_cond = #{entity.goCond},</if>
|
<if test="entity.backCond != null">back_cond = #{entity.backCond},</if>
|
<if test="entity.des != null">des = #{entity.des},</if>
|
<if test="entity.deleteStatus != null">delete_status = #{entity.deleteStatus},</if>
|
<if test="entity.custId != null">cust_id = #{entity.custId},</if>
|
<if test="entity.createTime != null">create_time = #{entity.createTime},</if>
|
<if test="entity.updateTime != null">update_time = #{entity.updateTime}</if>
|
</sql>
|
<!-- 条件 -->
|
<sql id="where-part">
|
<if test="terms != null">
|
<where>
|
<if test="terms.id != null and terms.id !=''">
|
and id = #{terms.id}
|
</if>
|
<if test="terms.flowId != null and terms.flowId !=''">
|
and flow_id = #{terms.flowId}
|
</if>
|
<if test="terms.flowableId != null and terms.flowableId !=''">
|
and flowable_id = #{terms.flowableId}
|
</if>
|
<if test="terms.nodeId != null and terms.nodeId !=''">
|
and node_id = #{terms.nodeId}
|
</if>
|
<if test="terms.nodeShowName != null and terms.nodeShowName !=''">
|
and node_show_name = #{terms.nodeShowName}
|
</if>
|
<if test="terms.nodeName != null and terms.nodeName !=''">
|
and node_name = #{terms.nodeName}
|
</if>
|
<if test="terms.nodeType != null and terms.nodeType !=''">
|
and node_type = #{terms.nodeType}
|
</if>
|
<if test="terms.nodeIndex != null and terms.nodeIndex !=''">
|
and node_index = #{terms.nodeIndex}
|
</if>
|
<if test="terms.nodeIcon != null and terms.nodeIcon !=''">
|
and node_icon = #{terms.nodeIcon}
|
</if>
|
<if test="terms.apiType != null and terms.apiType !=''">
|
and api_type = #{terms.apiType}
|
</if>
|
<if test="terms.api != null and terms.api !=''">
|
and api = #{terms.api}
|
</if>
|
<if test="terms.caseProcess != null and terms.caseProcess !=''">
|
and case_process = #{terms.caseProcess}
|
</if>
|
<if test="terms.caseProcessName != null and terms.caseProcessName !=''">
|
and case_process_name = #{terms.caseProcessName}
|
</if>
|
<if test="terms.expire != null and terms.expire !=''">
|
and expire = #{terms.expire}
|
</if>
|
<if test="terms.candeType != null and terms.candeType !=''">
|
and cande_type = #{terms.candeType}
|
</if>
|
<if test="terms.candeUnitId != null and terms.candeUnitId !=''">
|
and cande_unit_id = #{terms.candeUnitId}
|
</if>
|
<if test="terms.candeUnitName != null and terms.candeUnitName !=''">
|
and cande_unit_name = #{terms.candeUnitName}
|
</if>
|
<if test="terms.candeDeptId != null and terms.candeDeptId !=''">
|
and cande_dept_id = #{terms.candeDeptId}
|
</if>
|
<if test="terms.candeDeptName != null and terms.candeDeptName !=''">
|
and cande_dept_name = #{terms.candeDeptName}
|
</if>
|
<if test="terms.candeRoleCode != null and terms.candeRoleCode !=''">
|
and cande_role_code = #{terms.candeRoleCode}
|
</if>
|
<if test="terms.candeRoleName != null and terms.candeRoleName !=''">
|
and cande_role_name = #{terms.candeRoleName}
|
</if>
|
<if test="terms.candeUserId != null and terms.candeUserId !=''">
|
and cande_user_id = #{terms.candeUserId}
|
</if>
|
<if test="terms.candeUserName != null and terms.candeUserName !=''">
|
and cande_user_name = #{terms.candeUserName}
|
</if>
|
<if test="terms.goCond != null and terms.goCond !=''">
|
and go_cond = #{terms.goCond}
|
</if>
|
<if test="terms.backCond != null and terms.backCond !=''">
|
and back_cond = #{terms.backCond}
|
</if>
|
<if test="terms.des != null and terms.des !=''">
|
and des = #{terms.des}
|
</if>
|
<if test="terms.deleteStatus = null and terms.deleteStatus =''">
|
and delete_status = 0
|
</if>
|
<if test="terms.deleteStatus != null and terms.deleteStatus !=''">
|
and delete_status = #{terms.deleteStatus}
|
</if>
|
<if test="terms.custId != null and terms.custId !=''">
|
and cust_id = #{terms.custId}
|
</if>
|
<if test="terms.createTime != null and terms.createTime !=''">
|
and DATE_FORMAT(create_time,'%Y-%m-%d') = #{terms.createTime}
|
</if>
|
<if test="terms.createStart != null and terms.createStart !='' and terms.createEnd != null and terms.createEnd !=''">
|
and (DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.createStart}
|
and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.createEnd})
|
</if>
|
<if test="terms.updateTime != null and terms.updateTime !=''">
|
and DATE_FORMAT(update_time,'%Y-%m-%d') = #{terms.updateTime}
|
</if>
|
<if test="terms.updateStart != null and terms.updateStart !='' and terms.updateEnd != null and terms.updateEnd !=''">
|
and (DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ >= ]]> #{terms.updateStart}
|
and DATE_FORMAT(update_time,'%Y-%m-%d') <![CDATA[ <= ]]> #{terms.updateEnd})
|
</if>
|
</where>
|
</if>
|
</sql>
|
<!-- 更新对象 -->
|
<update id="updateFlowNode">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<where>
|
id = #{entity.id}
|
</where>
|
</update>
|
<!-- 条件更新对象 -->
|
<update id="updateFlowNodeTerms">
|
update
|
<include refid="table-name"/>
|
<set>
|
<include refid="set-part"/>
|
</set>
|
<include refid="where-part"/>
|
</update>
|
<!-- 根据编号物理删除 -->
|
<delete id="deleteFlowNode">
|
delete from
|
<include refid="table-name" />
|
where id = #{id}
|
</delete>
|
<!-- 根据条件查询 -->
|
<select id="listTerms" resultMap="dataResult">
|
select
|
<include refid="column-part"/>
|
from
|
<include refid="table-name" />
|
<include refid="where-part"/>
|
</select>
|
<!-- 根据条件统计 -->
|
<select id="countTerms" resultType="java.lang.Long">
|
select
|
COUNT(1)
|
from
|
<include refid="table-name" />
|
<include refid="where-part"/>
|
</select>
|
<!-- 根据条件分页查询 -->
|
<select id="pageTerms" resultMap="dataResult">
|
SELECT
|
<include refid="column-part"/>
|
FROM
|
<include refid="table-name" />
|
<include refid="where-part"/>
|
<if test="page.sort != null">
|
<foreach collection="page.sort" item="s" index="index" separator="," open="order by ">
|
isnull(${s.property}), ${s.property} ${s.direction}
|
</foreach>
|
</if>
|
<if test="page.sort == null">
|
order by isnull(create_time), create_time desc
|
</if>
|
limit #{page.offset}, #{page.size}
|
</select>
|
|
</mapper>
|