AppActivityMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.juxiao.xchat.module.xbd.mapper.home.AppActivityMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.home.AppActivity" >
  5. <id column="act_id" property="actId" jdbcType="INTEGER" />
  6. <result column="act_name" property="actName" jdbcType="VARCHAR" />
  7. <result column="act_status" property="actStatus" jdbcType="TINYINT" />
  8. <result column="act_alert_version" property="actAlertVersion" jdbcType="VARCHAR" />
  9. <result column="alert_win" property="alertWin" jdbcType="BIT" />
  10. <result column="alert_win_pic" property="alertWinPic" jdbcType="VARCHAR" />
  11. <result column="alert_win_loc" property="alertWinLoc" jdbcType="TINYINT" />
  12. <result column="skip_type" property="skipType" jdbcType="TINYINT" />
  13. <result column="skip_url" property="skipUrl" jdbcType="VARCHAR" />
  14. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. act_id, act_name, act_status, act_alert_version, alert_win, alert_win_pic, alert_win_loc,
  18. skip_type, skip_url, create_time
  19. </sql>
  20. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  21. select
  22. <include refid="Base_Column_List" />
  23. from app_activity
  24. where act_id = #{actId,jdbcType=INTEGER}
  25. </select>
  26. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.home.AppActivity" >
  27. <selectKey resultType="java.lang.Integer" keyProperty="actId" order="AFTER" >
  28. SELECT LAST_INSERT_ID()
  29. </selectKey>
  30. insert into app_activity (act_name, act_status, act_alert_version,
  31. alert_win, alert_win_pic, alert_win_loc,
  32. skip_type, skip_url, create_time
  33. )
  34. values (#{actName,jdbcType=VARCHAR}, #{actStatus,jdbcType=TINYINT}, #{actAlertVersion,jdbcType=VARCHAR},
  35. #{alertWin,jdbcType=BIT}, #{alertWinPic,jdbcType=VARCHAR}, #{alertWinLoc,jdbcType=TINYINT},
  36. #{skipType,jdbcType=TINYINT}, #{skipUrl,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  37. )
  38. </insert>
  39. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.AppActivity" >
  40. <selectKey resultType="java.lang.Integer" keyProperty="actId" order="AFTER" >
  41. SELECT LAST_INSERT_ID()
  42. </selectKey>
  43. insert into app_activity
  44. <trim prefix="(" suffix=")" suffixOverrides="," >
  45. <if test="actName != null" >
  46. act_name,
  47. </if>
  48. <if test="actStatus != null" >
  49. act_status,
  50. </if>
  51. <if test="actAlertVersion != null" >
  52. act_alert_version,
  53. </if>
  54. <if test="alertWin != null" >
  55. alert_win,
  56. </if>
  57. <if test="alertWinPic != null" >
  58. alert_win_pic,
  59. </if>
  60. <if test="alertWinLoc != null" >
  61. alert_win_loc,
  62. </if>
  63. <if test="skipType != null" >
  64. skip_type,
  65. </if>
  66. <if test="skipUrl != null" >
  67. skip_url,
  68. </if>
  69. <if test="createTime != null" >
  70. create_time,
  71. </if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides="," >
  74. <if test="actName != null" >
  75. #{actName,jdbcType=VARCHAR},
  76. </if>
  77. <if test="actStatus != null" >
  78. #{actStatus,jdbcType=TINYINT},
  79. </if>
  80. <if test="actAlertVersion != null" >
  81. #{actAlertVersion,jdbcType=VARCHAR},
  82. </if>
  83. <if test="alertWin != null" >
  84. #{alertWin,jdbcType=BIT},
  85. </if>
  86. <if test="alertWinPic != null" >
  87. #{alertWinPic,jdbcType=VARCHAR},
  88. </if>
  89. <if test="alertWinLoc != null" >
  90. #{alertWinLoc,jdbcType=TINYINT},
  91. </if>
  92. <if test="skipType != null" >
  93. #{skipType,jdbcType=TINYINT},
  94. </if>
  95. <if test="skipUrl != null" >
  96. #{skipUrl,jdbcType=VARCHAR},
  97. </if>
  98. <if test="createTime != null" >
  99. #{createTime,jdbcType=TIMESTAMP},
  100. </if>
  101. </trim>
  102. </insert>
  103. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.AppActivity" >
  104. update app_activity
  105. <set >
  106. <if test="actName != null" >
  107. act_name = #{actName,jdbcType=VARCHAR},
  108. </if>
  109. <if test="actStatus != null" >
  110. act_status = #{actStatus,jdbcType=TINYINT},
  111. </if>
  112. <if test="actAlertVersion != null" >
  113. act_alert_version = #{actAlertVersion,jdbcType=VARCHAR},
  114. </if>
  115. <if test="alertWin != null" >
  116. alert_win = #{alertWin,jdbcType=BIT},
  117. </if>
  118. <if test="alertWinPic != null" >
  119. alert_win_pic = #{alertWinPic,jdbcType=VARCHAR},
  120. </if>
  121. <if test="alertWinLoc != null" >
  122. alert_win_loc = #{alertWinLoc,jdbcType=TINYINT},
  123. </if>
  124. <if test="skipType != null" >
  125. skip_type = #{skipType,jdbcType=TINYINT},
  126. </if>
  127. <if test="skipUrl != null" >
  128. skip_url = #{skipUrl,jdbcType=VARCHAR},
  129. </if>
  130. <if test="createTime != null" >
  131. create_time = #{createTime,jdbcType=TIMESTAMP},
  132. </if>
  133. </set>
  134. where act_id = #{actId,jdbcType=INTEGER}
  135. </update>
  136. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.home.AppActivity" >
  137. update app_activity
  138. set act_name = #{actName,jdbcType=VARCHAR},
  139. act_status = #{actStatus,jdbcType=TINYINT},
  140. act_alert_version = #{actAlertVersion,jdbcType=VARCHAR},
  141. alert_win = #{alertWin,jdbcType=BIT},
  142. alert_win_pic = #{alertWinPic,jdbcType=VARCHAR},
  143. alert_win_loc = #{alertWinLoc,jdbcType=TINYINT},
  144. skip_type = #{skipType,jdbcType=TINYINT},
  145. skip_url = #{skipUrl,jdbcType=VARCHAR},
  146. create_time = #{createTime,jdbcType=TIMESTAMP}
  147. where act_id = #{actId,jdbcType=INTEGER}
  148. </update>
  149. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  150. delete from app_activity
  151. where act_id = #{actId,jdbcType=INTEGER}
  152. </delete>
  153. <select id="selectAppActivityByList" resultMap="BaseResultMap">
  154. select
  155. <include refid="Base_Column_List" />
  156. from app_activity
  157. where 1 = 1
  158. <if test="actStatus != null">
  159. and act_status = #{actStatus}
  160. </if>
  161. <if test="alertWinLoc != null ">
  162. and alert_win_loc = #{alertWinLoc}
  163. </if>
  164. <if test="skipType != null">
  165. and skip_type = #{skipType}
  166. </if>
  167. order by create_time desc
  168. </select>
  169. </mapper>