Mk2MemberBirthdayDao.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.kmall.admin.dao.mk.Mk2MemberBirthdayDao">
  4. <resultMap type="com.kmall.admin.entity.mk.Mk2MemberBirthdayEntity" id="mk2MemberBirthdayMap">
  5. <result property="mmbId" column="mmb_id"/>
  6. <result property="topicName" column="topic_name"/>
  7. <result property="topicType" column="topic_type"/>
  8. <result property="topicPrice" column="topic_price"/>
  9. <result property="topicProportion" column="topic_proportion"/>
  10. <result property="isValid" column="is_valid"/>
  11. <result property="createrSn" column="creater_sn"/>
  12. <result property="createTime" column="create_time"/>
  13. <result property="moderSn" column="moder_sn"/>
  14. <result property="modTime" column="mod_time"/>
  15. <result property="tstm" column="tstm"/>
  16. </resultMap>
  17. <select id="queryObject" resultType="com.kmall.admin.entity.mk.Mk2MemberBirthdayEntity">
  18. select
  19. `mmb_id`,
  20. `topic_name`,
  21. `topic_type`,
  22. `topic_price`,
  23. `topic_proportion`,
  24. `is_valid`,
  25. `creater_sn`,
  26. `create_time`,
  27. `moder_sn`,
  28. `mod_time`,
  29. `tstm`
  30. from mk2_member_birthday
  31. where mmb_id = #{id}
  32. </select>
  33. <select id="queryList" resultType="com.kmall.admin.entity.mk.Mk2MemberBirthdayEntity">
  34. select
  35. `mmb_id`,
  36. `topic_name`,
  37. `topic_type`,
  38. `topic_price`,
  39. `topic_proportion`,
  40. `is_valid`,
  41. `creater_sn`,
  42. `create_time`,
  43. `moder_sn`,
  44. `mod_time`,
  45. `tstm`
  46. from mk2_member_birthday
  47. WHERE 1=1
  48. <if test="topicName != null and topicName.trim() != ''">
  49. AND topic_name LIKE concat('%',#{topicName},'%')
  50. </if>
  51. <choose>
  52. <when test="sidx != null and sidx.trim() != ''">
  53. order by ${sidx} ${order}
  54. </when>
  55. <otherwise>
  56. order by mmb_id desc
  57. </otherwise>
  58. </choose>
  59. <if test="offset != null and limit != null">
  60. limit #{offset}, #{limit}
  61. </if>
  62. </select>
  63. <select id="queryTotal" resultType="int">
  64. select count(*) from mk2_member_birthday
  65. WHERE 1=1
  66. <if test="topicName != null and topicName.trim() != ''">
  67. AND topic_name LIKE concat('%',#{topicName},'%')
  68. </if>
  69. </select>
  70. <insert id="save" parameterType="com.kmall.admin.entity.mk.Mk2MemberBirthdayEntity" useGeneratedKeys="true" keyProperty="id">
  71. insert into mk2_member_birthday(
  72. `mmb_id`,
  73. `topic_name`,
  74. `topic_type`,
  75. `topic_price`,
  76. `topic_proportion`,
  77. `is_valid`,
  78. `creater_sn`,
  79. `create_time`,
  80. `moder_sn`,
  81. `mod_time`,
  82. `tstm`)
  83. values(
  84. #{mmbId},
  85. #{topicName},
  86. #{topicType},
  87. #{topicPrice},
  88. #{topicProportion},
  89. #{isValid},
  90. #{createrSn},
  91. #{createTime},
  92. #{moderSn},
  93. #{modTime},
  94. #{tstm})
  95. </insert>
  96. <update id="update" parameterType="com.kmall.admin.entity.mk.Mk2MemberBirthdayEntity">
  97. update mk2_member_birthday
  98. <set>
  99. <if test="topicName != null">`topic_name` = #{topicName}, </if>
  100. <if test="topicType != null">`topic_type` = #{topicType}, </if>
  101. <if test="topicPrice != null">`topic_price` = #{topicPrice}, </if>
  102. <if test="topicProportion != null">`topic_proportion` = #{topicProportion}, </if>
  103. <if test="isValid != null">`is_valid` = #{isValid}, </if>
  104. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  105. <if test="createTime != null">`create_time` = #{createTime}, </if>
  106. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  107. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  108. <if test="tstm != null">`tstm` = #{tstm}</if>
  109. </set>
  110. where mmb_id = #{mmbId}
  111. </update>
  112. <delete id="delete">
  113. delete from mk2_member_birthday where mmb_id = #{value}
  114. </delete>
  115. <delete id="deleteBatch">
  116. delete from mk2_member_birthday where mmb_id in
  117. <foreach item="mmbId" collection="array" open="(" separator="," close=")">
  118. #{mmbId}
  119. </foreach>
  120. </delete>
  121. </mapper>