123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <?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.WfInsMapper">
- <resultMap id="WfInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfInsDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="oc_name" property="ocName" jdbcType="VARCHAR" />
- <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
- <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
- <result column="wf_ins_title" property="wfInsTitle" jdbcType="VARCHAR" />
- <result column="status" property="status" jdbcType="BIGINT" />
- <result column="begin_time" property="beginTime" jdbcType="TIMESTAMP"/>
- <result column="finish_time" property="finishTime" jdbcType="TIMESTAMP"/>
- <result column="cur_activity_ins_id" property="curActivityInsId" jdbcType="BIGINT" />
- <result column="cur_activity_code" property="curActivityCode" jdbcType="VARCHAR" />
- <result column="cur_activity_title" property="curActivityTitle" jdbcType="VARCHAR" />
- <result column="cur_activity_begin_time" property="curActivityBeginTime" jdbcType="TIMESTAMP"/>
- <result column="cur_form_code" property="curFormCode" jdbcType="VARCHAR" />
- <result column="cur_group_id" property="curGroupId" jdbcType="BIGINT" />
- <result column="cur_position_id" property="curPositionId" jdbcType="BIGINT" />
- <result column="cur_account_id" property="curAccountId" jdbcType="BIGINT" />
- <result column="cur_group_name" property="curGroupName" jdbcType="VARCHAR" />
- <result column="cur_position_name" property="curPositionName" jdbcType="VARCHAR" />
- <result column="cur_account_name" property="curAccountName" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="WfInsDto_Cols">
- A.oc_id,
- B.oc_name,
- A.wf_def_id,
- A.wf_ins_id,
- A.wf_ins_title,
- A.status,
- A.begin_time,
- A.finish_time,
- A.cur_activity_ins_id,
- A.cur_activity_code,
- A.cur_activity_title,
- A.cur_activity_begin_time,
- A.cur_form_code,
- A.cur_group_id,
- A.cur_position_id,
- A.cur_account_id,
- A.cur_group_name,
- A.cur_position_name,
- A.cur_account_name
- </sql>
- <!--根据ID获取信息-->
- <select id="getById" resultMap="WfInsDtoResultMap">
- SELECT
- <include refid="WfInsDto_Cols"/>
- FROM wf_ins AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="wfInsId != null">
- AND A.wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="WfInsDtoResultMap">
- SELECT
- <include refid="WfInsDto_Cols"/>
- FROM wf_ins AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- WHERE A.deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- and A.wf_ins_title like "%"#{keywords}"%"
- </if>
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="wfDefId != null">
- AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- ORDER BY A.wf_ins_id DESC
- </select>
- <!--列表查询-->
- <select id="getByList" resultMap="WfInsDtoResultMap" parameterType="java.util.Map">
- SELECT
- <include refid="WfInsDto_Cols"/>
- FROM wf_ins AS A
- LEFT JOIN oc AS B ON (A.oc_id = B.oc_id)
- WHERE 1 = 1 AND A.deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND A.wf_ins_title like "%"#{keywords}"%"
- </if>
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="wfDefId != null">
- AND A.wf_def_id = #{wfDefId ,jdbcType=BIGINT}
- </if>
- <if test="status != null">
- AND A.status = #{status ,jdbcType=BIGINT}
- </if>
- ORDER BY A.wf_ins_id DESC
- </select>
- <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfIns">
- INSERT INTO wf_ins
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="wfDefId != null">
- wf_def_id,
- </if>
- <if test="wfInsId != null">
- wf_ins_id,
- </if>
- <if test="wfInsTitle != null and wfInsTitle !=''">
- wf_ins_title,
- </if>
- <if test="status != null">
- status ,
- </if>
- <if test="beginTime != null">
- begin_time ,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="wfDefId != null">
- #{wfDefId,jdbcType=BIGINT},
- </if>
- <if test="wfInsId != null">
- #{wfInsId ,jdbcType=BIGINT},
- </if>
- <if test="wfInsTitle != null and wfInsTitle !=''">
- #{wfInsTitle ,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status ,jdbcType=BIGINT},
- </if>
- <if test="beginTime != null">
- #{beginTime ,jdbcType=TIMESTAMP},
- </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.WfIns">
- UPDATE wf_ins
- <trim suffixOverrides=",">
- <set>
- <if test="wfInsTitle != null and wfInsTitle !=''">
- wf_ins_title = #{wfInsTitle ,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status ,jdbcType=BIGINT},
- </if>
- <if test="finishTime != null">
- finish_time = #{finishTime ,jdbcType=TIMESTAMP},
- </if>
- <if test="curGroupId != null">
- cur_group_id = #{curGroupId ,jdbcType=BIGINT} ,
- </if>
- <if test="curPositionId != null">
- cur_position_id = #{curPositionId ,jdbcType=BIGINT} ,
- </if>
- <if test="curAccountId != null">
- cur_account_id = #{curAccountId ,jdbcType=BIGINT} ,
- </if>
- <if test="curGroupName != null">
- cur_group_name = #{curGroupName ,jdbcType=VARCHAR} ,
- </if>
- <if test="curPositionName != null">
- cur_position_name = #{curPositionName ,jdbcType=VARCHAR} ,
- </if>
- <if test="curAccountName != null">
- cur_account_name = #{curAccountName ,jdbcType=VARCHAR} ,
- </if>
- <if test="curActivityInsId != null">
- cur_activity_ins_id = #{curActivityInsId ,jdbcType=BIGINT} ,
- </if>
- <if test="curActivityCode != null">
- cur_activity_code = #{curActivityCode ,jdbcType=VARCHAR} ,
- </if>
- <if test="curActivityTitle != null">
- cur_activity_title = #{curActivityTitle ,jdbcType=VARCHAR} ,
- </if>
- <if test="curFormCode != null">
- cur_form_code = #{curFormCode ,jdbcType=VARCHAR} ,
- </if>
- <if test="curActivityBeginTime != null">
- cur_activity_begin_time = #{curActivityBeginTime ,jdbcType=TIMESTAMP},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="wfInsId != null">
- AND wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE wf_ins
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 =1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="wfInsId != null">
- AND wf_ins_id = #{wfInsId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|