DeviceBeginnerGuideMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.watch.mapper.WatchBeginnerGuideMapper">
  6. <resultMap type="WatchBeginnerGuide" id="DeviceBeginnerGGuideResult">
  7. <result property="id" column="id" />
  8. <result property="title" column="title" />
  9. <result property="url" column="url" />
  10. <result property="type" column="type" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="isDel" column="is_del" />
  16. <result property="belong" column="belong" />
  17. </resultMap>
  18. <sql id="selectDeviceBeginnerGGuideVo">
  19. select id, title, url, type, create_by, create_time, update_by, update_time, is_del,belong from watch_beginner_guide
  20. </sql>
  21. <select id="selectWatchBeginnerGuideList" parameterType="WatchBeginnerGuide" resultMap="DeviceBeginnerGGuideResult">
  22. <include refid="selectDeviceBeginnerGGuideVo"/> where is_del = 0
  23. <if test="title != null and title != ''"> and title = #{title}</if>
  24. <if test="url != null and url != ''"> and url = #{url}</if>
  25. <if test="type != null "> and type = #{type}</if>
  26. <if test="isDel != null "> and is_del = #{isDel}</if>
  27. <if test="belong != null and belong!=''"> and belong = #{belong}</if>
  28. </select>
  29. <select id="selectWatchBeginnerGuideById" parameterType="Long" resultMap="DeviceBeginnerGGuideResult">
  30. <include refid="selectDeviceBeginnerGGuideVo"/>
  31. where id = #{id}
  32. </select>
  33. <insert id="insertWatchBeginnerGuide" parameterType="WatchBeginnerGuide" useGeneratedKeys="true" keyProperty="id">
  34. insert into watch_beginner_guide
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="title != null">title,</if>
  37. <if test="url != null">url,</if>
  38. <if test="type != null">type,</if>
  39. <if test="createBy != null">create_by,</if>
  40. <if test="createTime != null">create_time,</if>
  41. <if test="updateBy != null">update_by,</if>
  42. <if test="updateTime != null">update_time,</if>
  43. <if test="isDel != null">is_del,</if>
  44. <if test="belong != null and belong!=''">belong,</if>
  45. </trim>
  46. <trim prefix="values (" suffix=")" suffixOverrides=",">
  47. <if test="title != null">#{title},</if>
  48. <if test="url != null">#{url},</if>
  49. <if test="type != null">#{type},</if>
  50. <if test="createBy != null">#{createBy},</if>
  51. <if test="createTime != null">#{createTime},</if>
  52. <if test="updateBy != null">#{updateBy},</if>
  53. <if test="updateTime != null">#{updateTime},</if>
  54. <if test="isDel != null">#{isDel},</if>
  55. <if test="belong != null and belong!=''">#{belong}</if>
  56. </trim>
  57. </insert>
  58. <update id="updateWatchBeginnerGuide" parameterType="WatchBeginnerGuide">
  59. update watch_beginner_guide
  60. <trim prefix="SET" suffixOverrides=",">
  61. <if test="title != null">title = #{title},</if>
  62. <if test="url != null">url = #{url},</if>
  63. <if test="type != null">type = #{type},</if>
  64. <if test="createBy != null">create_by = #{createBy},</if>
  65. <if test="createTime != null">create_time = #{createTime},</if>
  66. <if test="updateBy != null">update_by = #{updateBy},</if>
  67. <if test="updateTime != null">update_time = #{updateTime},</if>
  68. <if test="isDel != null">is_del = #{isDel},</if>
  69. <if test="belong != null and belong!=''">belong = #{belong},</if>
  70. </trim>
  71. where id = #{id}
  72. </update>
  73. <delete id="deleteWatchBeginnerGuideById" parameterType="Long">
  74. delete from device_beginner_gGuide where id = #{id}
  75. </delete>
  76. <delete id="deleteWatchBeginnerGuideByIds" parameterType="String">
  77. delete from device_beginner_gGuide where id in
  78. <foreach item="id" collection="array" open="(" separator="," close=")">
  79. #{id}
  80. </foreach>
  81. </delete>
  82. </mapper>