| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415 |
- <?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.ydtech.modules.esm.dao.EsmTrainMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.esm.model.EsmTrain">
- <id column="trainid" jdbcType="VARCHAR" property="trainid"/>
- <result column="title" jdbcType="VARCHAR" property="title"/>
- <result column="t_describe" jdbcType="VARCHAR" property="tDescribe"/>
- <result column="status" jdbcType="VARCHAR" property="status"/>
- <result column="comcode" jdbcType="VARCHAR" property="comcode"/>
- <result column="fileid" jdbcType="VARCHAR" property="fileid"/>
- <result column="dirid" jdbcType="VARCHAR" property="dirid"/>
- <result column="userscope" jdbcType="VARCHAR" property="userscope"/>
- <result column="byzd_1" jdbcType="VARCHAR" property="byzd1"/>
- <result column="byzd_2" jdbcType="VARCHAR" property="byzd2"/>
- <result column="byzd_3" jdbcType="VARCHAR" property="byzd3"/>
- <result column="byzd_4" jdbcType="VARCHAR" property="byzd4"/>
- <result column="byzd_5" jdbcType="VARCHAR" property="byzd5"/>
- <result column="operatorcode" jdbcType="VARCHAR" property="operatorcode"/>
- <result column="operatime" jdbcType="DATE" property="operatime"/>
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="("
- separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="("
- separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- trainid, title, t_describe, status, comcode, fileid, dirid, userscope, byzd_1, byzd_2,
- byzd_3, byzd_4, byzd_5, operatorcode, operatime
- </sql>
- <select id="selectByExample" parameterType="com.ydtech.modules.esm.model.EsmTrainExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- 'true' as QUERYID,
- <include refid="Base_Column_List"/>
- from esm_train
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from esm_train
- where trainid = #{trainid,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from esm_train
- where trainid = #{trainid,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.ydtech.modules.esm.model.EsmTrainExample">
- delete from esm_train
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </delete>
- <insert id="insert" parameterType="com.ydtech.modules.esm.model.EsmTrain">
- insert into esm_train (trainid, title, t_describe,
- status, comcode, fileid,
- dirid, userscope, byzd_1,
- byzd_2, byzd_3, byzd_4,
- byzd_5, operatorcode, operatime)
- values (#{trainid,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{tDescribe,jdbcType=VARCHAR},
- #{status,jdbcType=VARCHAR}, #{comcode,jdbcType=VARCHAR}, #{fileid,jdbcType=VARCHAR},
- #{dirid,jdbcType=VARCHAR}, #{userscope,jdbcType=VARCHAR}, #{byzd1,jdbcType=VARCHAR},
- #{byzd2,jdbcType=VARCHAR}, #{byzd3,jdbcType=VARCHAR}, #{byzd4,jdbcType=VARCHAR},
- #{byzd5,jdbcType=VARCHAR}, #{operatorcode,jdbcType=VARCHAR}, #{operatime,jdbcType=DATE})
- </insert>
- <insert id="insertSelective" parameterType="com.ydtech.modules.esm.model.EsmTrain">
- insert into esm_train
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="trainid != null">
- trainid,
- </if>
- <if test="title != null">
- title,
- </if>
- <if test="tDescribe != null">
- t_describe,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="comcode != null">
- comcode,
- </if>
- <if test="fileid != null">
- fileid,
- </if>
- <if test="dirid != null">
- dirid,
- </if>
- <if test="userscope != null">
- userscope,
- </if>
- <if test="byzd1 != null">
- byzd_1,
- </if>
- <if test="byzd2 != null">
- byzd_2,
- </if>
- <if test="byzd3 != null">
- byzd_3,
- </if>
- <if test="byzd4 != null">
- byzd_4,
- </if>
- <if test="byzd5 != null">
- byzd_5,
- </if>
- <if test="operatorcode != null">
- operatorcode,
- </if>
- <if test="operatime != null">
- operatime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="trainid != null">
- #{trainid,jdbcType=VARCHAR},
- </if>
- <if test="title != null">
- #{title,jdbcType=VARCHAR},
- </if>
- <if test="tDescribe != null">
- #{tDescribe,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- <if test="comcode != null">
- #{comcode,jdbcType=VARCHAR},
- </if>
- <if test="fileid != null">
- #{fileid,jdbcType=VARCHAR},
- </if>
- <if test="dirid != null">
- #{dirid,jdbcType=VARCHAR},
- </if>
- <if test="userscope != null">
- #{userscope,jdbcType=VARCHAR},
- </if>
- <if test="byzd1 != null">
- #{byzd1,jdbcType=VARCHAR},
- </if>
- <if test="byzd2 != null">
- #{byzd2,jdbcType=VARCHAR},
- </if>
- <if test="byzd3 != null">
- #{byzd3,jdbcType=VARCHAR},
- </if>
- <if test="byzd4 != null">
- #{byzd4,jdbcType=VARCHAR},
- </if>
- <if test="byzd5 != null">
- #{byzd5,jdbcType=VARCHAR},
- </if>
- <if test="operatorcode != null">
- #{operatorcode,jdbcType=VARCHAR},
- </if>
- <if test="operatime != null">
- #{operatime,jdbcType=DATE},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.ydtech.modules.esm.model.EsmTrainExample"
- resultType="java.lang.Long">
- select count(*) from esm_train
- <if test="_parameter != null">
- <include refid="Example_Where_Clause"/>
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update esm_train
- <set>
- <if test="record.trainid != null">
- trainid = #{record.trainid,jdbcType=VARCHAR},
- </if>
- <if test="record.title != null">
- title = #{record.title,jdbcType=VARCHAR},
- </if>
- <if test="record.tDescribe != null">
- t_describe = #{record.tDescribe,jdbcType=VARCHAR},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=VARCHAR},
- </if>
- <if test="record.comcode != null">
- comcode = #{record.comcode,jdbcType=VARCHAR},
- </if>
- <if test="record.fileid != null">
- fileid = #{record.fileid,jdbcType=VARCHAR},
- </if>
- <if test="record.dirid != null">
- dirid = #{record.dirid,jdbcType=VARCHAR},
- </if>
- <if test="record.userscope != null">
- userscope = #{record.userscope,jdbcType=VARCHAR},
- </if>
- <if test="record.byzd1 != null">
- byzd_1 = #{record.byzd1,jdbcType=VARCHAR},
- </if>
- <if test="record.byzd2 != null">
- byzd_2 = #{record.byzd2,jdbcType=VARCHAR},
- </if>
- <if test="record.byzd3 != null">
- byzd_3 = #{record.byzd3,jdbcType=VARCHAR},
- </if>
- <if test="record.byzd4 != null">
- byzd_4 = #{record.byzd4,jdbcType=VARCHAR},
- </if>
- <if test="record.byzd5 != null">
- byzd_5 = #{record.byzd5,jdbcType=VARCHAR},
- </if>
- <if test="record.operatorcode != null">
- operatorcode = #{record.operatorcode,jdbcType=VARCHAR},
- </if>
- <if test="record.operatime != null">
- operatime = #{record.operatime,jdbcType=DATE},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update esm_train
- set trainid = #{record.trainid,jdbcType=VARCHAR},
- title = #{record.title,jdbcType=VARCHAR},
- t_describe = #{record.tDescribe,jdbcType=VARCHAR},
- status = #{record.status,jdbcType=VARCHAR},
- comcode = #{record.comcode,jdbcType=VARCHAR},
- fileid = #{record.fileid,jdbcType=VARCHAR},
- dirid = #{record.dirid,jdbcType=VARCHAR},
- userscope = #{record.userscope,jdbcType=VARCHAR},
- byzd_1 = #{record.byzd1,jdbcType=VARCHAR},
- byzd_2 = #{record.byzd2,jdbcType=VARCHAR},
- byzd_3 = #{record.byzd3,jdbcType=VARCHAR},
- byzd_4 = #{record.byzd4,jdbcType=VARCHAR},
- byzd_5 = #{record.byzd5,jdbcType=VARCHAR},
- operatorcode = #{record.operatorcode,jdbcType=VARCHAR},
- operatime = #{record.operatime,jdbcType=DATE}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause"/>
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.esm.model.EsmTrain">
- update esm_train
- <set>
- <if test="title != null">
- title = #{title,jdbcType=VARCHAR},
- </if>
- <if test="tDescribe != null">
- t_describe = #{tDescribe,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- <if test="comcode != null">
- comcode = #{comcode,jdbcType=VARCHAR},
- </if>
- <if test="fileid != null">
- fileid = #{fileid,jdbcType=VARCHAR},
- </if>
- <if test="dirid != null">
- dirid = #{dirid,jdbcType=VARCHAR},
- </if>
- <if test="userscope != null">
- userscope = #{userscope,jdbcType=VARCHAR},
- </if>
- <if test="byzd1 != null">
- byzd_1 = #{byzd1,jdbcType=VARCHAR},
- </if>
- <if test="byzd2 != null">
- byzd_2 = #{byzd2,jdbcType=VARCHAR},
- </if>
- <if test="byzd3 != null">
- byzd_3 = #{byzd3,jdbcType=VARCHAR},
- </if>
- <if test="byzd4 != null">
- byzd_4 = #{byzd4,jdbcType=VARCHAR},
- </if>
- <if test="byzd5 != null">
- byzd_5 = #{byzd5,jdbcType=VARCHAR},
- </if>
- <if test="operatorcode != null">
- operatorcode = #{operatorcode,jdbcType=VARCHAR},
- </if>
- <if test="operatime != null">
- operatime = #{operatime,jdbcType=DATE},
- </if>
- </set>
- where trainid = #{trainid,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.esm.model.EsmTrain">
- update esm_train
- set title = #{title,jdbcType=VARCHAR},
- t_describe = #{tDescribe,jdbcType=VARCHAR},
- status = #{status,jdbcType=VARCHAR},
- comcode = #{comcode,jdbcType=VARCHAR},
- fileid = #{fileid,jdbcType=VARCHAR},
- dirid = #{dirid,jdbcType=VARCHAR},
- userscope = #{userscope,jdbcType=VARCHAR},
- byzd_1 = #{byzd1,jdbcType=VARCHAR},
- byzd_2 = #{byzd2,jdbcType=VARCHAR},
- byzd_3 = #{byzd3,jdbcType=VARCHAR},
- byzd_4 = #{byzd4,jdbcType=VARCHAR},
- byzd_5 = #{byzd5,jdbcType=VARCHAR},
- operatorcode = #{operatorcode,jdbcType=VARCHAR},
- operatime = #{operatime,jdbcType=DATE}
- where trainid = #{trainid,jdbcType=VARCHAR}
- </update>
- <update id="updateCount">
- update esm_train
- set byzd_3 = (IFNULL(#{byzd3,jdbcType=VARCHAR}, 0) + 1)
- where trainid = #{trainid,jdbcType=VARCHAR}
- </update>
- <!-- 如果传进来OPERATORCODE,那么只查询该发布人发布的培训信息 -->
- <select id="queryTrainByCode" parameterType="com.ydtech.modules.esm.model.EsmTrain" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM esm_train
- <trim prefix="WHERE" prefixOverrides="AND">
- <if test="title != null and title != ''">
- AND TITLE LIKE CONCAT(CONCAT('%',#{title}),'%')
- </if>
- <if test="trainid != null and trainid != ''">
- AND TRAINID = #{trainid,jdbcType=VARCHAR}
- </if>
- <if test="operatorcode != null and operatorcode != ''">
- AND OPERATORCODE = #{operatorcode,jdbcType=VARCHAR}
- </if>
- <if test="status != null and status != ''">
- AND STATUS = #{status,jdbcType=VARCHAR}
- </if>
- <if test="comcode != null and comcode != ''">
- AND COMCODE LIKE CONCAT(CONCAT('%',#{comcode}),'%')
- </if>
- <if test="fileid != null and fileid != ''">
- AND FILEID = #{fileid,jdbcType=VARCHAR}
- </if>
- <if test="dirid != null and dirid != ''">
- AND DIRID = #{dirid,jdbcType=VARCHAR}
- </if>
- <if test="userscope != null and userscope != ''">
- AND (USERSCOPE = #{userscope,jdbcType=VARCHAR} or USERSCOPE = 'ALL')
- </if>
- <if test="byzd1 != null and byzd1 != ''">
- AND BYZD_1 = #{byzd1,jdbcType=VARCHAR}
- </if>
- </trim>
- </select>
- </mapper>
|