123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?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.WfActivityDefMapper">
- <resultMap id="WfActivityDefDtoResultMap" type="com.zhyc.xps.bpm.dto.WfActivityDefDto">
- <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
- <result column="activity_def_id" property="activityDefId" jdbcType="BIGINT" />
- <result column="activity_def_title" property="activityDefTitle" jdbcType="VARCHAR" />
- <result column="activity_def_desc" property="activityDefDesc" jdbcType="VARCHAR" />
- <result column="activity_code" property="activityCode" jdbcType="VARCHAR" />
- <result column="form_code" property="formCode" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="WfActivityDefDto_Column_List">
- wf_def_id ,
- activity_def_id,
- activity_def_title,
- activity_def_desc,
- activity_code,
- form_code
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="WfActivityDefDtoResultMap">
- SELECT
- <include refid="WfActivityDefDto_Column_List"/>
- FROM wf_activity_def
- WHERE deleted_flag = 0
- <if test="wfDefId != null">
- AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="WfActivityDefDtoResultMap">
- SELECT
- <include refid="WfActivityDefDto_Column_List"/>
- FROM wf_activity_def
- WHERE deleted_flag = 0
- <if test="wfDefId != null">
- AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND activity_def_title like "%"#{keywords}"%"
- </if>
- ORDER BY activity_def_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="WfActivityDefDtoResultMap">
- SELECT
- <include refid="WfActivityDefDto_Column_List"/>
- FROM wf_activity_def
- WHERE deleted_flag = 0
- <if test="wfDefId != null">
- AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND activity_def_title like "%"#{keywords}"%"
- </if>
- </select>
- <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfActivityDef">
- INSERT INTO wf_activity_def
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="wfDefId != null">
- wf_def_id,
- </if>
- <if test="activityDefId != null">
- activity_def_id,
- </if>
- <if test="activityDefTitle != null and activityDefTitle != ''">
- activity_def_title,
- </if>
- <if test="activityDefDesc != null and activityDefDesc != ''">
- activity_def_desc,
- </if>
- <if test="activityCode != null and activityCode != ''">
- activity_code,
- </if>
- <if test="formCode != null and formCode != ''">
- form_code,
- </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">
- #{wfDefId ,jdbcType=BIGINT},
- </if>
- <if test="activityDefId != null">
- #{activityDefId ,jdbcType=BIGINT},
- </if>
- <if test="activityDefTitle != null and activityDefTitle != ''">
- #{activityDefTitle ,jdbcType=VARCHAR},
- </if>
- <if test="activityDefDesc != null and activityDefDesc != ''">
- #{activityDefDesc ,jdbcType=VARCHAR},
- </if>
- <if test="activityCode != null and activityCode != ''">
- #{activityCode ,jdbcType=VARCHAR},
- </if>
- <if test="formCode != null and formCode != ''">
- #{formCode ,jdbcType=VARCHAR},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=DATE},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfActivityDef">
- UPDATE wf_activity_def
- <trim suffixOverrides=",">
- <set>
- <if test="activityDefTitle != null and activityDefTitle != ''">
- activity_def_title = #{activityDefTitle, jdbcType=VARCHAR},
- </if>
- <if test="activityDefDesc != null and activityDefDesc != ''">
- activity_def_desc = #{activityDefDesc, jdbcType=VARCHAR},
- </if>
- <if test="activityCode != null and activityCode != ''">
- activity_code = #{activityCode ,jdbcType=VARCHAR},
- </if>
- <if test="formCode != null and formCode != ''">
- form_code = #{formCode ,jdbcType=VARCHAR},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=DATE},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="wfDefId != null">
- AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE wf_activity_def
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=DATE},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="wfDefId != null">
- AND wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="activityDefId != null">
- AND activity_def_id = #{activityDefId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|