BdglCookcategoryMapper.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.supervision.system.mapper.BdglCookcategoryMapper">
  6. <resultMap type="BdglCookcategory" id="BdglCookcategoryResult">
  7. <result property="id" column="id" />
  8. <result property="typelist" column="typelist" />
  9. <result property="timelist" column="timelist" />
  10. <result property="name" column="name" />
  11. <result property="createtime" column="createtime" />
  12. <result property="updatetime" column="updatetime" />
  13. </resultMap>
  14. <sql id="selectBdglCookcategoryVo">
  15. select id, typelist, timelist, name, createtime, updatetime from bdgl_cookcategory
  16. </sql>
  17. <select id="selectBdglCookcategoryList" parameterType="BdglCookcategory" resultMap="BdglCookcategoryResult">
  18. <include refid="selectBdglCookcategoryVo"/>
  19. <where>
  20. <if test="typelist != null "> and typelist = #{typelist}</if>
  21. <if test="timelist != null "> and timelist = #{timelist}</if>
  22. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  23. <if test="createtime != null "> and createtime = #{createtime}</if>
  24. <if test="updatetime != null "> and updatetime = #{updatetime}</if>
  25. </where>
  26. </select>
  27. <select id="selectBdglCookcategoryById" parameterType="Integer" resultMap="BdglCookcategoryResult">
  28. <include refid="selectBdglCookcategoryVo"/>
  29. where id = #{id}
  30. </select>
  31. <select id="select" resultMap="BdglCookcategoryResult">
  32. <include refid="selectBdglCookcategoryVo"/>
  33. where id in
  34. <foreach item="item" collection="split" index="index" open="(" separator="," close=")">
  35. #{item}
  36. </foreach>
  37. </select>
  38. <insert id="insertBdglCookcategory" parameterType="BdglCookcategory" useGeneratedKeys="true" keyProperty="id">
  39. insert into bdgl_cookcategory
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="typelist != null">typelist,</if>
  42. <if test="timelist != null">timelist,</if>
  43. <if test="name != null and name != ''">name,</if>
  44. <if test="createtime != null">createtime,</if>
  45. <if test="updatetime != null">updatetime,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="typelist != null">#{typelist},</if>
  49. <if test="timelist != null">#{timelist},</if>
  50. <if test="name != null and name != ''">#{name},</if>
  51. <if test="createtime != null">#{createtime},</if>
  52. <if test="updatetime != null">#{updatetime},</if>
  53. </trim>
  54. </insert>
  55. <update id="updateBdglCookcategory" parameterType="BdglCookcategory">
  56. update bdgl_cookcategory
  57. <trim prefix="SET" suffixOverrides=",">
  58. <if test="typelist != null">typelist = #{typelist},</if>
  59. <if test="timelist != null">timelist = #{timelist},</if>
  60. <if test="name != null and name != ''">name = #{name},</if>
  61. <if test="createtime != null">createtime = #{createtime},</if>
  62. <if test="updatetime != null">updatetime = #{updatetime},</if>
  63. </trim>
  64. where id = #{id}
  65. </update>
  66. <delete id="deleteBdglCookcategoryById" parameterType="Integer">
  67. delete from bdgl_cookcategory where id = #{id}
  68. </delete>
  69. <delete id="deleteBdglCookcategoryByIds" parameterType="String">
  70. delete from bdgl_cookcategory where id in
  71. <foreach item="id" collection="array" open="(" separator="," close=")">
  72. #{id}
  73. </foreach>
  74. </delete>
  75. </mapper>