123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?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.WfExampleMapper">
- <resultMap id="WfExampleInsDtoResultMap" type="com.zhyc.xps.bpm.dto.WfExampleInsDto" >
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="example_id" property="exampleId" jdbcType="BIGINT" />
- <result column="example_title" property="exampleTitle" jdbcType="VARCHAR" />
- <result column="example_desc" property="exampleDesc" jdbcType="VARCHAR" />
- <result column="wf_def_id" property="wfDefId" jdbcType="BIGINT" />
- <result column="wf_ins_id" property="wfInsId" jdbcType="BIGINT" />
- <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="WfExampleInsDto_Cols">
- A.oc_id,
- A.example_id,
- A.example_title,
- A.example_desc,
- W.wf_def_id,
- W.wf_ins_id,
- W.cur_activity_title,
- W.cur_activity_code,
- W.cur_form_code,
- W.cur_activity_ins_id,
- W.cur_group_id,
- W.cur_activity_begin_time,
- W.cur_group_id,
- W.cur_group_name,
- W.cur_position_id,
- W.cur_position_name,
- W.cur_account_id,
- W.cur_account_name
- </sql>
- <!--根据ID获取信息-->
- <select id="getById" resultMap="WfExampleInsDtoResultMap">
- SELECT
- <include refid="WfExampleInsDto_Cols"/>
- FROM wf_example AS A
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.example_id = W.wf_ins_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="exampleId != null">
- AND A.example_id = #{exampleId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询信息-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="WfExampleInsDtoResultMap">
- SELECT
- <include refid="WfExampleInsDto_Cols"/>
- FROM wf_example AS A
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.example_id = W.wf_ins_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- and A.example_title like "%"#{keywords}"%"
- </if>
- ORDER BY example_id ASC
- </select>
- <select id="getByList" resultMap="WfExampleInsDtoResultMap" parameterType="java.util.Map">
- SELECT
- <include refid="WfExampleInsDto_Cols"/>
- FROM wf_example AS A
- LEFT JOIN wf_ins AS W ON (A.oc_id = W.oc_id AND A.example_id = W.wf_ins_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- and A.example_title like "%"#{keywords}"%"
- </if>
- </select>
- <insert id="create" parameterType="com.zhyc.xps.bpm.entity.WfExample">
- INSERT INTO wf_example
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="exampleId != null">
- example_id,
- </if>
- <if test="exampleTitle != null">
- example_title,
- </if>
- <if test="exampleDesc != null">
- example_desc,
- </if>
- <if test="status != null">
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="exampleId != null">
- #{exampleId ,jdbcType=BIGINT},
- </if>
- <if test="exampleTitle != null">
- #{exampleTitle ,jdbcType=VARCHAR},
- </if>
- <if test="exampleDesc != null">
- #{exampleDesc ,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status ,jdbcType=BIGINT},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.bpm.entity.WfExample">
- UPDATE wf_example
- <trim suffixOverrides=",">
- <set>
- <if test="exampleTitle != null and exampleTitle != ''">
- example_title = #{exampleTitle, jdbcType=VARCHAR},
- </if>
- <if test="exampleDesc != null and exampleDesc != ''">
- example_desc = #{exampleDesc, jdbcType=VARCHAR},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="exampleId != null">
- AND example_id = #{exampleId ,jdbcType=BIGINT}
- </if>
- </update>
- <!--删除-->
- <delete id="delete" parameterType="java.util.Map">
- delete from wf_example
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="exampleId != null">
- AND example_id = #{exampleId ,jdbcType=BIGINT}
- </if>
- </delete>
- </mapper>
|