123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <?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.zhyc.xps.bpm.mapper.WfActivityActionDefMapper">
- <resultMap id="BaseResultMap" type="com.zhyc.xps.bpm.entity.WfActivityActionDef">
- <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
- <result column="activity_def_id" property="activityDefId" jdbcType="BIGINT" />
- <result column="action_id" property="actionId" jdbcType="BIGINT" />
- <result column="action_title" property="actionTitle" jdbcType="VARCHAR"/>
- <result column="action_desc" property="actionDesc" jdbcType="VARCHAR"/>
- <result column="action_code" property="actionCode" jdbcType="VARCHAR"/>
- <result column="form_code" property="formCode" jdbcType="VARCHAR"/>
- <result column="target_activity_def_id" property="targetActivityDefId" jdbcType="BIGINT" />
- </resultMap>
- <resultMap id="WfInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfActivityActionDefDto" extends="BaseResultMap">
- <result column="target_activity_def_title" property="targetActivityDefTitle" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Ext_Column_List">
- A.wf_def_id,
- A.activity_def_id,
- A.action_id,
- A.action_title,
- A.action_desc,
- A.action_code,
- A.form_code,
- A.target_activity_def_id,
- B.activity_def_title AS target_activity_def_title
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="WfInsDtoResultMap">
- SELECT
- <include refid="Ext_Column_List"/>
- FROM wf_activity_action_def AS A
- LEFT JOIN wf_activity_def AS B ON (A.wf_def_id = B.wf_def_id AND A.target_activity_def_id = B.activity_def_id)
- WHERE A.deleted_flag = 0
- <if test="wfDefId != null">
- AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- <if test="actionId != null">
- AND A.action_id = #{actionId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="WfInsDtoResultMap">
- SELECT
- <include refid="Ext_Column_List"/>
- FROM wf_activity_action_def AS A
- LEFT JOIN wf_activity_def AS B ON (A.wf_def_id = B.wf_def_id AND A.target_activity_def_id = B.activity_def_id)
- WHERE A.deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND A.action_title like "%"#{keywords}"%"
- </if>
- <if test="wfDefId != null">
- AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- <if test="actionId != null">
- AND A.action_id = #{actionId ,jdbcType=BIGINT}
- </if>
- ORDER BY A.action_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" resultMap="WfInsDtoResultMap" >
- SELECT
- <include refid="Ext_Column_List"/>
- FROM wf_activity_action_def AS A
- LEFT JOIN wf_activity_def AS B ON (A.wf_def_id = B.wf_def_id AND A.target_activity_def_id = B.activity_def_id)
- WHERE A.deleted_flag = 0
- <if test="wfDefId != null">
- AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND A.activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- ORDER BY A.action_id
- </select>
- <!--新增-->
- <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfActivityActionDef">
- INSERT INTO wf_activity_action_def
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="wfDefId != null">
- wf_def_id,
- </if>
- <if test="activityDefId != null">
- activity_def_id,
- </if>
- <if test="actionId != null">
- action_id,
- </if>
- <if test="actionTitle != null and actionTitle != ''">
- action_title,
- </if>
- <if test="actionDesc != null and actionDesc != ''">
- action_desc,
- </if>
- <if test="actionCode != null and actionCode != ''">
- action_code,
- </if>
- <if test="formCode != null and formCode != ''">
- form_code,
- </if>
- <if test="targetActivityDefId != null">
- target_activity_def_id,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="wfDefId != null and wfDefId !=''">
- #{wfDefId ,jdbcType=BIGINT},
- </if>
- <if test="activityDefId != null">
- #{activityDefId ,jdbcType=BIGINT},
- </if>
- <if test="actionId != null">
- #{actionId ,jdbcType=BIGINT},
- </if>
- <if test="actionTitle != null and actionTitle != ''">
- #{actionTitle ,jdbcType=VARCHAR},
- </if>
- <if test="actionDesc != null and actionDesc != ''">
- #{actionDesc ,jdbcType=VARCHAR},
- </if>
- <if test="actionCode != null and actionCode != ''">
- #{actionCode ,jdbcType=VARCHAR},
- </if>
- <if test="formCode != null and formCode != ''">
- #{formCode ,jdbcType=VARCHAR},
- </if>
- <if test="targetActivityDefId != null">
- #{targetActivityDefId ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfActivityActionDef">
- UPDATE wf_activity_action_def
- <trim suffixOverrides=",">
- <set>
- <if test="actionTitle != null and actionTitle != ''">
- action_title = #{actionTitle ,jdbcType=VARCHAR},
- </if>
- <if test="actionDesc != null and actionDesc != ''">
- action_desc = #{actionDesc ,jdbcType=VARCHAR},
- </if>
- <if test="actionCode != null and actionCode != ''">
- action_code = #{actionCode ,jdbcType=VARCHAR},
- </if>
- <if test="formCode != null and formCode != ''">
- form_code = #{formCode ,jdbcType=VARCHAR},
- </if>
- <if test="targetActivityDefId != null">
- target_activity_def_id = #{targetActivityDefId ,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- <if test="actionId != null">
- AND action_id = #{actionId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE wf_activity_action_def
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=VARCHAR},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- <if test="actionId != null">
- AND action_id = #{actionId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|