ActivityInfo.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.enterprise.modules.base.dao.ActivityInfoDAO">
  6. <resultMap id="ActivityInfoMap" type="com.jpsoft.enterprise.modules.base.entity.ActivityInfo">
  7. <id property="id" column="id_" />
  8. <result property="title" column="title_" />
  9. <result property="startTime" column="start_time" />
  10. <result property="endTime" column="end_time" />
  11. <result property="picUrl" column="pic_url" />
  12. <result property="content" column="content_" />
  13. <result property="status" column="status_" />
  14. <result property="createBy" column="create_by" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. <result property="delFlag" column="del_flag" />
  19. <result property="sortNo" column="sort_no"/>
  20. </resultMap>
  21. <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.ActivityInfo">
  22. <!--
  23. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  24. select sys_guid() from dual
  25. </selectKey>
  26. -->
  27. <![CDATA[
  28. insert into base_activity_info
  29. (id_,title_,start_time,end_time,pic_url,content_,status_,create_by,create_time,update_by,update_time,del_flag,sort_no)
  30. values
  31. (
  32. #{id,jdbcType=VARCHAR}
  33. ,#{title,jdbcType=VARCHAR}
  34. ,#{startTime,jdbcType= TIMESTAMP }
  35. ,#{endTime,jdbcType= TIMESTAMP }
  36. ,#{picUrl,jdbcType=VARCHAR}
  37. ,#{content,jdbcType= NUMERIC }
  38. ,#{status,jdbcType= NUMERIC }
  39. ,#{createBy,jdbcType=VARCHAR}
  40. ,#{createTime,jdbcType= TIMESTAMP }
  41. ,#{updateBy,jdbcType=VARCHAR}
  42. ,#{updateTime,jdbcType= TIMESTAMP }
  43. ,#{delFlag,jdbcType= NUMERIC }
  44. ,#{sortNo,jdbcType=INTEGER}
  45. )
  46. ]]>
  47. </insert>
  48. <delete id="delete" parameterType="string">
  49. delete from base_activity_info where id_=#{id,jdbcType=VARCHAR}
  50. </delete>
  51. <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.ActivityInfo">
  52. update base_activity_info
  53. <set>
  54. <if test="title!=null">
  55. title_=#{title,jdbcType=VARCHAR},
  56. </if>
  57. <if test="startTime!=null">
  58. start_time=#{startTime,jdbcType= TIMESTAMP },
  59. </if>
  60. <if test="endTime!=null">
  61. end_time=#{endTime,jdbcType= TIMESTAMP },
  62. </if>
  63. <if test="picUrl!=null">
  64. pic_url=#{picUrl,jdbcType=VARCHAR},
  65. </if>
  66. <if test="content!=null">
  67. content_=#{content,jdbcType= NUMERIC },
  68. </if>
  69. <if test="status!=null">
  70. status_=#{status,jdbcType= NUMERIC },
  71. </if>
  72. <if test="createBy!=null">
  73. create_by=#{createBy,jdbcType=VARCHAR},
  74. </if>
  75. <if test="createTime!=null">
  76. create_time=#{createTime,jdbcType= TIMESTAMP },
  77. </if>
  78. <if test="updateBy!=null">
  79. update_by=#{updateBy,jdbcType=VARCHAR},
  80. </if>
  81. <if test="updateTime!=null">
  82. update_time=#{updateTime,jdbcType= TIMESTAMP },
  83. </if>
  84. <if test="delFlag!=null">
  85. del_flag=#{delFlag,jdbcType= NUMERIC },
  86. </if>
  87. <if test="sortNo!=null">
  88. sort_no=#{sortNo,jdbcType=INTEGER },
  89. </if>
  90. </set>
  91. where id_=#{id}
  92. </update>
  93. <select id="get" parameterType="string" resultMap="ActivityInfoMap">
  94. select * from base_activity_info where id_=#{0} and del_flag = 0
  95. </select>
  96. <select id="exist" parameterType="string" resultType="int">
  97. select count(*) from base_activity_info where id_=#{0}
  98. </select>
  99. <select id="list" resultMap="ActivityInfoMap">
  100. select * from base_activity_info
  101. </select>
  102. <select id="search" parameterType="hashmap" resultMap="ActivityInfoMap">
  103. <![CDATA[
  104. select a.* from
  105. base_activity_info a
  106. ]]>
  107. <where>
  108. a.del_flag = 0
  109. <if test="searchParams.id != null">
  110. and a.ID_ like #{searchParams.id}
  111. </if>
  112. <if test="searchParams.title != null">
  113. and a.title_ like #{searchParams.title}
  114. </if>
  115. <if test="searchParams.status != null">
  116. and status_ = #{searchParams.status}
  117. </if>
  118. </where>
  119. <foreach item="sort" collection="sortList" open="order by" separator=",">
  120. ${sort.name} ${sort.order}
  121. </foreach>
  122. </select>
  123. </mapper>