| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.enterprise.modules.base.dao.ActivityInfoDAO">
- <resultMap id="ActivityInfoMap" type="com.jpsoft.enterprise.modules.base.entity.ActivityInfo">
- <id property="id" column="id_" />
- <result property="title" column="title_" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- <result property="picUrl" column="pic_url" />
- <result property="content" column="content_" />
- <result property="status" column="status_" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- <result property="sortNo" column="sort_no"/>
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.ActivityInfo">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_activity_info
- (id_,title_,start_time,end_time,pic_url,content_,status_,create_by,create_time,update_by,update_time,del_flag,sort_no)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{title,jdbcType=VARCHAR}
- ,#{startTime,jdbcType= TIMESTAMP }
- ,#{endTime,jdbcType= TIMESTAMP }
- ,#{picUrl,jdbcType=VARCHAR}
- ,#{content,jdbcType= NUMERIC }
- ,#{status,jdbcType= NUMERIC }
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{sortNo,jdbcType=INTEGER}
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_activity_info where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.ActivityInfo">
- update base_activity_info
- <set>
- <if test="title!=null">
- title_=#{title,jdbcType=VARCHAR},
- </if>
- <if test="startTime!=null">
- start_time=#{startTime,jdbcType= TIMESTAMP },
- </if>
- <if test="endTime!=null">
- end_time=#{endTime,jdbcType= TIMESTAMP },
- </if>
- <if test="picUrl!=null">
- pic_url=#{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="content!=null">
- content_=#{content,jdbcType= NUMERIC },
- </if>
- <if test="status!=null">
- status_=#{status,jdbcType= NUMERIC },
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="sortNo!=null">
- sort_no=#{sortNo,jdbcType=INTEGER },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="ActivityInfoMap">
- select * from base_activity_info where id_=#{0} and del_flag = 0
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_activity_info where id_=#{0}
- </select>
- <select id="list" resultMap="ActivityInfoMap">
- select * from base_activity_info
- </select>
- <select id="search" parameterType="hashmap" resultMap="ActivityInfoMap">
- <![CDATA[
- select a.* from
- base_activity_info a
- ]]>
- <where>
- a.del_flag = 0
- <if test="searchParams.id != null">
- and a.ID_ like #{searchParams.id}
- </if>
- <if test="searchParams.title != null">
- and a.title_ like #{searchParams.title}
- </if>
- <if test="searchParams.status != null">
- and status_ = #{searchParams.status}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- </mapper>
|