1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?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.cool.bang.modules.mysql.mapper.FlowMapper">
- <!-- //////////////////////审批流程//////////////////////////////-->
- <!-- 结果集 -->
- <resultMap id="ApprovalFlowMap" type="com.cool.bang.modules.mysql.domain.flowPo.ApprovalFlow">
- <id property="id" column="id"/>
- <result property="flowNumber" column="flow_number" jdbcType="VARCHAR"/>
- <result property="flowName" column="flow_name" jdbcType="VARCHAR"/>
- <result property="flowType" column="flow_type" jdbcType="INTEGER"/>
- </resultMap>
- <!-- 返回单条记录 -->
- <select id="selectFlowByType" resultMap="ApprovalFlowMap">
- select
- id, flow_number, flow_type, flow_name
- from
- fc_approval_flow
- where
- flow_type = #{type} and state = 1
- </select>
- <!--//////////////////////审批节点//////////////////////////////-->
- <!-- 结果集 -->
- <resultMap id="ApprovalNodeMap" type="com.cool.bang.modules.mysql.domain.flowPo.ApprovalNode">
- <id property="id" column="id"/>
- <result property="flowId" column="flow_id" jdbcType="BIGINT"/>
- <result property="nodeType" column="node_type" jdbcType="TINYINT"/>
- <result property="nodeName" column="node_name" jdbcType="VARCHAR"/>
- <result property="prevNodeId" column="prev_node_id" jdbcType="BIGINT"/>
- <result property="nextNodeId" column="next_node_id" jdbcType="BIGINT"/>
- <result property="userId" column="user_id" jdbcType="BIGINT"/>
- <result property="userName" column="user_name" jdbcType="VARCHAR"/>
- <result property="number" column="number" jdbcType="INTEGER"/>
- <result property="delFlag" column="del_flag" jdbcType="TINYINT"/>
- <result property="flowNumber" column="flow_number" jdbcType="VARCHAR"/>
- </resultMap>
- <!-- 根据流程号查询节点 -->
- <select id="selectNodeByFlowNumber" resultMap="ApprovalNodeMap">
- select
- t.id, t.flow_id, t.node_type, t.node_name, t.prev_node_id, t.next_node_id, t.user_id, t.user_name, t.number, t.remark, t.create_by
- from
- fc_approval_node t
- left join fc_approval_flow t2 on t2.id = t.flow_id
- where
- t2.flow_number = #{flowNumber}
- order by
- t.node_type asc
- </select>
- <!--//////////////////////审批记录//////////////////////////////-->
- <!-- 插入一条记录 -->
- <insert id="insertRecord" parameterType="com.cool.bang.modules.mysql.domain.flowPo.ApprovalRecord">
- insert into
- fc_approval_record (id, business_number, flow_number,table_id, node_id, node_name, approver_id, approver, approval_time, approval_status, approval_remark, create_time, update_time, del_flag)
- values
- (#{id}, #{businessNumber}, #{flowNumber}, #{tableId}, #{nodeId}, #{nodeName}, #{approverId}, #{approver}, #{approvalTime}, #{approvalStatus}, #{approvalRemark}, #{createTime}, #{updateTime}, #{delFlag})
- </insert>
- <!-- 批量插入 -->
- <insert id="insertRecordBatch" parameterType="com.cool.bang.modules.mysql.domain.flowPo.ApprovalRecord">
- insert into
- fc_approval_record (id, business_number, flow_number,table_id, node_id, node_name, approver_id, approver, approval_time, approval_status, approval_remark, create_time, update_time, del_flag)
- values
- <foreach collection="list" item="item" separator=",">
- (#{item.id}, #{item.businessNumber}, #{item.flowNumber}, #{item.tableId}, #{item.nodeId}, #{item.nodeName}, #{item.approverId}, #{item.approver}, #{item.approvalTime}, #{item.approvalStatus}, #{item.approvalRemark}, #{item.createTime}, #{item.updateTime}, #{item.delFlag})
- </foreach>
- </insert>
- </mapper>
|