diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml index 795c9c7a..adc6a741 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml @@ -2,280 +2,311 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.hzya.frame.sys.flow.dao.impl.SysFlowStepDaoImpl"> - <resultMap id="get-SysFlowStepEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepEntity" > - <result property="id" column="id" jdbcType="VARCHAR"/> - <result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/> - <result property="create_time" column="create_time" jdbcType="TIMESTAMP"/> - <result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/> - <result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/> - <result property="sts" column="sts" jdbcType="VARCHAR"/> - <result property="step" column="step" jdbcType="INTEGER"/> - <result property="stepType" column="step_type" jdbcType="VARCHAR"/> - <result property="description" column="description" jdbcType="VARCHAR"/> - <result property="apiName" column="api_name" jdbcType="VARCHAR"/> - <result property="actionType" column="action_type" jdbcType="VARCHAR"/> - <result property="appId" column="app_id" jdbcType="VARCHAR"/> - <result property="apiId" column="api_id" jdbcType="VARCHAR"/> - <result property="nifiAppId" column="nifi_app_id" jdbcType="VARCHAR"/> - <result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/> - <result property="sortMode" column="sort_mode" jdbcType="VARCHAR"/> - </resultMap> + <resultMap id="get-SysFlowStepEntity-result" type="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + <result property="id" column="id" jdbcType="VARCHAR"/> + <result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/> + <result property="create_time" column="create_time" jdbcType="TIMESTAMP"/> + <result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/> + <result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/> + <result property="sts" column="sts" jdbcType="VARCHAR"/> + <result property="step" column="step" jdbcType="INTEGER"/> + <result property="stepType" column="step_type" jdbcType="VARCHAR"/> + <result property="flowId" column="flow_id" jdbcType="VARCHAR"/> + <result property="description" column="description" jdbcType="VARCHAR"/> + <result property="apiName" column="api_name" jdbcType="VARCHAR"/> + <result property="actionType" column="action_type" jdbcType="VARCHAR"/> + <result property="appId" column="app_id" jdbcType="VARCHAR"/> + <result property="apiId" column="api_id" jdbcType="VARCHAR"/> + <result property="nifiAppId" column="nifi_app_id" jdbcType="VARCHAR"/> + <result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/> + <result property="sortMode" column="sort_mode" jdbcType="VARCHAR"/> + </resultMap> <!-- 查询的字段--> - <sql id = "SysFlowStepEntity_Base_Column_List"> + <sql id="SysFlowStepEntity_Base_Column_List"> id - ,create_user_id + ,create_user_id ,create_time ,modify_user_id ,modify_time ,sts ,step ,step_type - ,description + ,flowId + ,description ,api_name ,action_type ,app_id ,api_id ,nifi_app_id ,nifi_api_id - ,sort_mode - </sql> - <!-- 查询 采用==查询 --> - <select id="entity_list_base" resultMap="get-SysFlowStepEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> - select - <include refid="SysFlowStepEntity_Base_Column_List" /> - from sys_flow_step - <trim prefix="where" prefixOverrides="and"> - <if test="id != null and id != ''"> and id = #{id} </if> - <if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if> - <if test="create_time != null"> and create_time = #{create_time} </if> - <if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if> - <if test="modify_time != null"> and modify_time = #{modify_time} </if> - <if test="sts != null and sts != ''"> and sts = #{sts} </if> - <if test="step != null"> and step = #{step} </if> - <if test="stepType != null and stepType != ''"> and step_type = #{stepType} </if> - <if test="description != null and description != ''"> and description = #{description} </if> - <if test="apiName != null and apiName != ''"> and api_name = #{apiName} </if> - <if test="actionType != null and actionType != ''"> and action_type = #{actionType} </if> - <if test="appId != null and appId != ''"> and app_id = #{appId} </if> - <if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if> - <if test="nifiAppId != null and nifiAppId != ''"> and nifi_app_id = #{nifiAppId} </if> - <if test="nifiApiId != null and nifiApiId != ''"> and nifi_api_id = #{nifiApiId} </if> - <if test="sortMode != null and sortMode != ''"> and sort_mode = #{sortMode} </if> + ,sort_mode + </sql> + <!-- 查询 采用==查询 --> + <select id="entity_list_base" resultMap="get-SysFlowStepEntity-result" + parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + select + <include refid="SysFlowStepEntity_Base_Column_List"/> + from sys_flow_step + <trim prefix="where" prefixOverrides="and"> + <if test="id != null and id != ''">and id = #{id}</if> + <if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if> + <if test="create_time != null">and create_time = #{create_time}</if> + <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if> + <if test="modify_time != null">and modify_time = #{modify_time}</if> + <if test="sts != null and sts != ''">and sts = #{sts}</if> + <if test="step != null">and step = #{step}</if> + <if test="stepType != null and stepType != ''">and step_type = #{stepType}</if> + <if test="flowId != null and flowId != ''">and flow_id = #{flowId}</if> + <if test="description != null and description != ''">and description = #{description}</if> + <if test="apiName != null and apiName != ''">and api_name = #{apiName}</if> + <if test="actionType != null and actionType != ''">and action_type = #{actionType}</if> + <if test="appId != null and appId != ''">and app_id = #{appId}</if> + <if test="apiId != null and apiId != ''">and api_id = #{apiId}</if> + <if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if> + <if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if> + <if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if> and sts='Y' - </trim> - <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> - <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> -</select> - -<!-- 查询符合条件的数量 --> -<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> - select count(1) from sys_flow_step - <trim prefix="where" prefixOverrides="and"> - <if test="id != null and id != ''"> and id = #{id} </if> - <if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if> - <if test="create_time != null"> and create_time = #{create_time} </if> - <if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if> - <if test="modify_time != null"> and modify_time = #{modify_time} </if> - <if test="sts != null and sts != ''"> and sts = #{sts} </if> - <if test="step != null"> and step = #{step} </if> - <if test="stepType != null and stepType != ''"> and step_type = #{stepType} </if> - <if test="description != null and description != ''"> and description = #{description} </if> - <if test="apiName != null and apiName != ''"> and api_name = #{apiName} </if> - <if test="actionType != null and actionType != ''"> and action_type = #{actionType} </if> - <if test="appId != null and appId != ''"> and app_id = #{appId} </if> - <if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if> - <if test="nifiAppId != null and nifiAppId != ''"> and nifi_app_id = #{nifiAppId} </if> - <if test="nifiApiId != null and nifiApiId != ''"> and nifi_api_id = #{nifiApiId} </if> - <if test="sortMode != null and sortMode != ''"> and sort_mode = #{sortMode} </if> + </trim> + <if test=" sort == null or sort == ''.toString() ">order by sorts asc</if> + <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> + </select> + + <!-- 查询符合条件的数量 --> + <select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + select count(1) from sys_flow_step + <trim prefix="where" prefixOverrides="and"> + <if test="id != null and id != ''">and id = #{id}</if> + <if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if> + <if test="create_time != null">and create_time = #{create_time}</if> + <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if> + <if test="modify_time != null">and modify_time = #{modify_time}</if> + <if test="sts != null and sts != ''">and sts = #{sts}</if> + <if test="step != null">and step = #{step}</if> + <if test="stepType != null and stepType != ''">and step_type = #{stepType}</if> + <if test="flowId != null and flowId != ''">and flow_id = #{flowId}</if> + <if test="description != null and description != ''">and description = #{description}</if> + <if test="apiName != null and apiName != ''">and api_name = #{apiName}</if> + <if test="actionType != null and actionType != ''">and action_type = #{actionType}</if> + <if test="appId != null and appId != ''">and app_id = #{appId}</if> + <if test="apiId != null and apiId != ''">and api_id = #{apiId}</if> + <if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if> + <if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if> + <if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if> and sts='Y' - </trim> - <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> - <if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if> + </trim> + <if test=" sort == null or sort == ''.toString() ">order by sorts asc</if> + <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> </select> <!-- 分页查询列表 采用like格式 --> -<select id="entity_list_like" resultMap="get-SysFlowStepEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> - select - <include refid="SysFlowStepEntity_Base_Column_List" /> - from sys_flow_step - <trim prefix="where" prefixOverrides="and"> - <if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if> - <if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if> - <if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if> - <if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if> - <if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if> - <if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if> - <if test="step != null"> and step like concat('%',#{step},'%') </if> - <if test="stepType != null and stepType != ''"> and step_type like concat('%',#{stepType},'%') </if> - <if test="description != null and description != ''"> and description like concat('%',#{description},'%') </if> - <if test="apiName != null and apiName != ''"> and api_name like concat('%',#{apiName},'%') </if> - <if test="actionType != null and actionType != ''"> and action_type like concat('%',#{actionType},'%') </if> - <if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if> - <if test="apiId != null and apiId != ''"> and api_id like concat('%',#{apiId},'%') </if> - <if test="nifiAppId != null and nifiAppId != ''"> and nifi_app_id like concat('%',#{nifiAppId},'%') </if> - <if test="nifiApiId != null and nifiApiId != ''"> and nifi_api_id like concat('%',#{nifiApiId},'%') </if> - <if test="sortMode != null and sortMode != ''"> and sort_mode like concat('%',#{sortMode},'%') </if> + <select id="entity_list_like" resultMap="get-SysFlowStepEntity-result" + parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + select + <include refid="SysFlowStepEntity_Base_Column_List"/> + from sys_flow_step + <trim prefix="where" prefixOverrides="and"> + <if test="id != null and id != ''">and id like concat('%',#{id},'%')</if> + <if test="create_user_id != null and create_user_id != ''">and create_user_id like + concat('%',#{create_user_id},'%') + </if> + <if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if> + <if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like + concat('%',#{modify_user_id},'%') + </if> + <if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if> + <if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if> + <if test="step != null">and step like concat('%',#{step},'%')</if> + <if test="stepType != null and stepType != ''">and step_type like concat('%',#{stepType},'%')</if> + <if test="flowId != null and flowId != ''">and flow_id like concat('%',#{flowId},'%')</if> + <if test="description != null and description != ''">and description like concat('%',#{description},'%') + </if> + <if test="apiName != null and apiName != ''">and api_name like concat('%',#{apiName},'%')</if> + <if test="actionType != null and actionType != ''">and action_type like concat('%',#{actionType},'%')</if> + <if test="appId != null and appId != ''">and app_id like concat('%',#{appId},'%')</if> + <if test="apiId != null and apiId != ''">and api_id like concat('%',#{apiId},'%')</if> + <if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id like concat('%',#{nifiAppId},'%')</if> + <if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id like concat('%',#{nifiApiId},'%')</if> + <if test="sortMode != null and sortMode != ''">and sort_mode like concat('%',#{sortMode},'%')</if> and sts='Y' - </trim> - <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> - <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> -</select> + </trim> + <if test=" sort == null or sort == ''.toString() ">order by sorts asc</if> + <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> + </select> -<!-- 查询列表 字段采用or格式 --> -<select id="SysFlowStepentity_list_or" resultMap="get-SysFlowStepEntity-result" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> - select - <include refid="SysFlowStepEntity_Base_Column_List" /> - from sys_flow_step - <trim prefix="where" prefixOverrides="and"> - <if test="id != null and id != ''"> or id = #{id} </if> - <if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if> - <if test="create_time != null"> or create_time = #{create_time} </if> - <if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if> - <if test="modify_time != null"> or modify_time = #{modify_time} </if> - <if test="sts != null and sts != ''"> or sts = #{sts} </if> - <if test="step != null"> or step = #{step} </if> - <if test="stepType != null and stepType != ''"> or step_type = #{stepType} </if> - <if test="description != null and description != ''"> or description = #{description} </if> - <if test="apiName != null and apiName != ''"> or api_name = #{apiName} </if> - <if test="actionType != null and actionType != ''"> or action_type = #{actionType} </if> - <if test="appId != null and appId != ''"> or app_id = #{appId} </if> - <if test="apiId != null and apiId != ''"> or api_id = #{apiId} </if> - <if test="nifiAppId != null and nifiAppId != ''"> or nifi_app_id = #{nifiAppId} </if> - <if test="nifiApiId != null and nifiApiId != ''"> or nifi_api_id = #{nifiApiId} </if> - <if test="sortMode != null and sortMode != ''"> or sort_mode = #{sortMode} </if> + <!-- 查询列表 字段采用or格式 --> + <select id="SysFlowStepentity_list_or" resultMap="get-SysFlowStepEntity-result" + parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + select + <include refid="SysFlowStepEntity_Base_Column_List"/> + from sys_flow_step + <trim prefix="where" prefixOverrides="and"> + <if test="id != null and id != ''">or id = #{id}</if> + <if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if> + <if test="create_time != null">or create_time = #{create_time}</if> + <if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if> + <if test="modify_time != null">or modify_time = #{modify_time}</if> + <if test="sts != null and sts != ''">or sts = #{sts}</if> + <if test="step != null">or step = #{step}</if> + <if test="stepType != null and stepType != ''">or step_type = #{stepType}</if> + <if test="flowId != null and flowId != ''">or flow_id = #{flowId}</if> + <if test="description != null and description != ''">or description = #{description}</if> + <if test="apiName != null and apiName != ''">or api_name = #{apiName}</if> + <if test="actionType != null and actionType != ''">or action_type = #{actionType}</if> + <if test="appId != null and appId != ''">or app_id = #{appId}</if> + <if test="apiId != null and apiId != ''">or api_id = #{apiId}</if> + <if test="nifiAppId != null and nifiAppId != ''">or nifi_app_id = #{nifiAppId}</if> + <if test="nifiApiId != null and nifiApiId != ''">or nifi_api_id = #{nifiApiId}</if> + <if test="sortMode != null and sortMode != ''">or sort_mode = #{sortMode}</if> and sts='Y' - </trim> - <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if> - <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> -</select> + </trim> + <if test=" sort == null or sort == ''.toString() ">order by sorts asc</if> + <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if> + </select> -<!--新增所有列--> -<insert id="entity_insert" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity" keyProperty="id" useGeneratedKeys="true"> - insert into sys_flow_step( - <trim suffix="" suffixOverrides=","> - <if test="id != null and id != ''"> id , </if> - <if test="create_user_id != null and create_user_id != ''"> create_user_id , </if> - <if test="create_time != null"> create_time , </if> - <if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if> - <if test="modify_time != null"> modify_time , </if> - <if test="sts != null and sts != ''"> sts , </if> - <if test="step != null"> step , </if> - <if test="stepType != null and stepType != ''"> step_type , </if> - <if test="description != null and description != ''"> description , </if> - <if test="apiName != null and apiName != ''"> api_name , </if> - <if test="actionType != null and actionType != ''"> action_type , </if> - <if test="appId != null and appId != ''"> app_id , </if> - <if test="apiId != null and apiId != ''"> api_id , </if> - <if test="nifiAppId != null and nifiAppId != ''"> nifi_app_id , </if> - <if test="nifiApiId != null and nifiApiId != ''"> nifi_api_id , </if> - <if test="sortMode != null and sortMode != ''"> sort_mode , </if> + <!--新增所有列--> + <insert id="entity_insert" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity" keyProperty="id" + useGeneratedKeys="true"> + insert into sys_flow_step( + <trim suffix="" suffixOverrides=","> + <if test="id != null and id != ''">id ,</if> + <if test="create_user_id != null and create_user_id != ''">create_user_id ,</if> + <if test="create_time != null">create_time ,</if> + <if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if> + <if test="modify_time != null">modify_time ,</if> + <if test="sts != null and sts != ''">sts ,</if> + <if test="step != null">step ,</if> + <if test="stepType != null and stepType != ''">step_type ,</if> + <if test="flowId != null and flowId != ''">flow_id ,</if> + <if test="description != null and description != ''">description ,</if> + <if test="apiName != null and apiName != ''">api_name ,</if> + <if test="actionType != null and actionType != ''">action_type ,</if> + <if test="appId != null and appId != ''">app_id ,</if> + <if test="apiId != null and apiId != ''">api_id ,</if> + <if test="nifiAppId != null and nifiAppId != ''">nifi_app_id ,</if> + <if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if> + <if test="sortMode != null and sortMode != ''">sort_mode ,</if> <if test="sorts == null ">sorts,</if> - <if test="sts == null ">sts,</if> - </trim> - )values( - <trim suffix="" suffixOverrides=","> - <if test="id != null and id != ''"> #{id} ,</if> - <if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if> - <if test="create_time != null"> #{create_time} ,</if> - <if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if> - <if test="modify_time != null"> #{modify_time} ,</if> - <if test="sts != null and sts != ''"> #{sts} ,</if> - <if test="step != null"> #{step} ,</if> - <if test="stepType != null and stepType != ''"> #{stepType} ,</if> - <if test="description != null and description != ''"> #{description} ,</if> - <if test="apiName != null and apiName != ''"> #{apiName} ,</if> - <if test="actionType != null and actionType != ''"> #{actionType} ,</if> - <if test="appId != null and appId != ''"> #{appId} ,</if> - <if test="apiId != null and apiId != ''"> #{apiId} ,</if> - <if test="nifiAppId != null and nifiAppId != ''"> #{nifiAppId} ,</if> - <if test="nifiApiId != null and nifiApiId != ''"> #{nifiApiId} ,</if> - <if test="sortMode != null and sortMode != ''"> #{sortMode} ,</if> - <if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a WHERE a.sts = 'Y' ),1),</if> - <if test="sts == null ">'Y',</if> - </trim> - ) -</insert> -<!-- 批量新增 --> -<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true"> - insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode, sts) - values - <foreach collection="entities" item="entity" separator=","> - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}, 'Y') - </foreach> -</insert> -<!-- 批量新增或者修改--> -<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> - insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode) - values - <foreach collection="entities" item="entity" separator=","> - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}) - </foreach> - on duplicate key update - create_user_id = values(create_user_id), - create_time = values(create_time), - modify_user_id = values(modify_user_id), - modify_time = values(modify_time), - sts = values(sts), - step = values(step), - step_type = values(step_type), - description = values(description), - api_name = values(api_name), - action_type = values(action_type), - app_id = values(app_id), - api_id = values(api_id), - nifi_app_id = values(nifi_app_id), - nifi_api_id = values(nifi_api_id), - sort_mode = values(sort_mode)</insert> -<!--通过主键修改方法--> -<update id="entity_update" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity" > -update sys_flow_step set -<trim suffix="" suffixOverrides=","> - <if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if> - <if test="create_time != null"> create_time = #{create_time},</if> - <if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if> - <if test="modify_time != null"> modify_time = #{modify_time},</if> - <if test="sts != null and sts != ''"> sts = #{sts},</if> - <if test="step != null"> step = #{step},</if> - <if test="stepType != null and stepType != ''"> step_type = #{stepType},</if> - <if test="description != null and description != ''"> description = #{description},</if> - <if test="apiName != null and apiName != ''"> api_name = #{apiName},</if> - <if test="actionType != null and actionType != ''"> action_type = #{actionType},</if> - <if test="appId != null and appId != ''"> app_id = #{appId},</if> - <if test="apiId != null and apiId != ''"> api_id = #{apiId},</if> - <if test="nifiAppId != null and nifiAppId != ''"> nifi_app_id = #{nifiAppId},</if> - <if test="nifiApiId != null and nifiApiId != ''"> nifi_api_id = #{nifiApiId},</if> - <if test="sortMode != null and sortMode != ''"> sort_mode = #{sortMode},</if> -</trim> -where id = #{id} -</update> -<!-- 逻辑删除 --> -<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity" > -update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} -</update> -<!-- 多条件逻辑删除 --> -<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.flow.entity.SysFlowStepEntity" > -update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - <trim prefix="where" prefixOverrides="and"> - <if test="id != null and id != ''"> and id = #{id} </if> - <if test="sts != null and sts != ''"> and sts = #{sts} </if> - <if test="step != null"> and step = #{step} </if> - <if test="stepType != null and stepType != ''"> and step_type = #{stepType} </if> - <if test="description != null and description != ''"> and description = #{description} </if> - <if test="apiName != null and apiName != ''"> and api_name = #{apiName} </if> - <if test="actionType != null and actionType != ''"> and action_type = #{actionType} </if> - <if test="appId != null and appId != ''"> and app_id = #{appId} </if> - <if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if> - <if test="nifiAppId != null and nifiAppId != ''"> and nifi_app_id = #{nifiAppId} </if> - <if test="nifiApiId != null and nifiApiId != ''"> and nifi_api_id = #{nifiApiId} </if> - <if test="sortMode != null and sortMode != ''"> and sort_mode = #{sortMode} </if> + <if test="sts == null ">sts,</if> + </trim> + )values( + <trim suffix="" suffixOverrides=","> + <if test="id != null and id != ''">#{id} ,</if> + <if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if> + <if test="create_time != null">#{create_time} ,</if> + <if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if> + <if test="modify_time != null">#{modify_time} ,</if> + <if test="sts != null and sts != ''">#{sts} ,</if> + <if test="step != null">#{step} ,</if> + <if test="stepType != null and stepType != ''">#{stepType} ,</if> + <if test="flowId != null and flowId != ''">#{flowId} ,</if> + <if test="description != null and description != ''">#{description} ,</if> + <if test="apiName != null and apiName != ''">#{apiName} ,</if> + <if test="actionType != null and actionType != ''">#{actionType} ,</if> + <if test="appId != null and appId != ''">#{appId} ,</if> + <if test="apiId != null and apiId != ''">#{apiId} ,</if> + <if test="nifiAppId != null and nifiAppId != ''">#{nifiAppId} ,</if> + <if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if> + <if test="sortMode != null and sortMode != ''">#{sortMode} ,</if> + <if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a + WHERE a.sts = 'Y' ),1), + </if> + <if test="sts == null ">'Y',</if> + </trim> + ) + </insert> + <!-- 批量新增 --> + <insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true"> + insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, + step_type,flow_id, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode, sts) + values + <foreach collection="entities" item="entity" separator=","> + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.flowId},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}, + 'Y') + </foreach> + </insert> + <!-- 批量新增或者修改--> + <insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> + insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, + flow_id,description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode) + values + <foreach collection="entities" item="entity" separator=","> + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.flowId},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}) + </foreach> + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + step = values(step), + step_type = values(step_type), + flow_id = values(flow_id), + description = values(description), + api_name = values(api_name), + action_type = values(action_type), + app_id = values(app_id), + api_id = values(api_id), + nifi_app_id = values(nifi_app_id), + nifi_api_id = values(nifi_api_id), + sort_mode = values(sort_mode) + </insert> + <!--通过主键修改方法--> + <update id="entity_update" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + update sys_flow_step set + <trim suffix="" suffixOverrides=","> + <if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if> + <if test="create_time != null">create_time = #{create_time},</if> + <if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if> + <if test="modify_time != null">modify_time = #{modify_time},</if> + <if test="sts != null and sts != ''">sts = #{sts},</if> + <if test="step != null">step = #{step},</if> + <if test="stepType != null and stepType != ''">step_type = #{stepType},</if> + <if test="flowId != null and flowId != ''">flow_id = #{flowId},</if> + <if test="description != null and description != ''">description = #{description},</if> + <if test="apiName != null and apiName != ''">api_name = #{apiName},</if> + <if test="actionType != null and actionType != ''">action_type = #{actionType},</if> + <if test="appId != null and appId != ''">app_id = #{appId},</if> + <if test="apiId != null and apiId != ''">api_id = #{apiId},</if> + <if test="nifiAppId != null and nifiAppId != ''">nifi_app_id = #{nifiAppId},</if> + <if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if> + <if test="sortMode != null and sortMode != ''">sort_mode = #{sortMode},</if> + </trim> + where id = #{id} + </update> + <!-- 逻辑删除 --> + <update id="entity_logicDelete" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + update sys_flow_step + set sts= 'N', + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id} + where id = #{id} + </update> + <!-- 多条件逻辑删除 --> + <update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.flow.entity.SysFlowStepEntity"> + update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + <trim prefix="where" prefixOverrides="and"> + <if test="id != null and id != ''">and id = #{id}</if> + <if test="sts != null and sts != ''">and sts = #{sts}</if> + <if test="step != null">and step = #{step}</if> + <if test="stepType != null and stepType != ''">and step_type = #{stepType}</if> + <if test="flowId != null and flowId != ''">and flow_id = #{flowId}</if> + <if test="description != null and description != ''">and description = #{description}</if> + <if test="apiName != null and apiName != ''">and api_name = #{apiName}</if> + <if test="actionType != null and actionType != ''">and action_type = #{actionType}</if> + <if test="appId != null and appId != ''">and app_id = #{appId}</if> + <if test="apiId != null and apiId != ''">and api_id = #{apiId}</if> + <if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if> + <if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if> + <if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if> and sts='Y' - </trim> -</update> -<!--通过主键删除--> -<delete id="entity_delete"> - delete from sys_flow_step where id = #{id} -</delete> + </trim> + </update> + <!--通过主键删除--> + <delete id="entity_delete"> + delete + from sys_flow_step + where id = #{id} + </delete> </mapper>