BkDestinationRecordPicMapper.xml 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.miniapp.bus.mapper.BkDestinationRecordPicMapper">
  6. <resultMap type="BkDestinationRecordPic" id="BkDestinationRecordPicResult">
  7. <result property="id" column="id" />
  8. <result property="destinationRecordId" column="destination_record_id" />
  9. <result property="picAddr" column="pic_addr" />
  10. <result property="picNode" column="pic_node" />
  11. <result property="imgUrl" column="img_url" />
  12. <result property="createBy" column="create_by" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="remark" column="remark" />
  17. </resultMap>
  18. <sql id="selectBkDestinationRecordPicVo">
  19. select id, destination_record_id, pic_addr, create_by, create_time, update_by, update_time, remark,pic_node,img_url from bk_destination_record_pic
  20. </sql>
  21. <select id="selectBkDestinationRecordPicList" parameterType="BkDestinationRecordPic" resultMap="BkDestinationRecordPicResult">
  22. <include refid="selectBkDestinationRecordPicVo"/>
  23. <where>
  24. <if test="destinationRecordId != null "> and destination_record_id = #{destinationRecordId}</if>
  25. <if test="picAddr != null and picAddr != ''"> and pic_addr = #{picAddr}</if>
  26. <if test="picNode != null and picNode != ''"> and pic_node = #{picNode}</if>
  27. </where>
  28. ORDER BY pic_node ASC
  29. </select>
  30. <select id="selectBkDestinationRecordPicById" parameterType="Long" resultMap="BkDestinationRecordPicResult">
  31. <include refid="selectBkDestinationRecordPicVo"/>
  32. where id = #{id}
  33. </select>
  34. <insert id="insertBkDestinationRecordPic" parameterType="BkDestinationRecordPic" useGeneratedKeys="true" keyProperty="id">
  35. <selectKey keyProperty="fileId" resultType="Long" order="AFTER">
  36. select LAST_INSERT_ID()
  37. </selectKey>
  38. insert into bk_destination_record_pic
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="destinationRecordId != null">destination_record_id,</if>
  41. <if test="picAddr != null and picAddr != ''">pic_addr,</if>
  42. <if test="picNode != null and picNode != ''">pic_node,</if>
  43. <if test="imgUrl != null and imgUrl != ''">img_url,</if>
  44. <if test="createBy != null">create_by,</if>
  45. <if test="createTime != null">create_time,</if>
  46. <if test="updateBy != null">update_by,</if>
  47. <if test="updateTime != null">update_time,</if>
  48. <if test="remark != null">remark,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="destinationRecordId != null">#{destinationRecordId},</if>
  52. <if test="picAddr != null and picAddr != ''">#{picAddr},</if>
  53. <if test="picNode != null and picNode != ''">#{picNode},</if>
  54. <if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
  55. <if test="createBy != null">#{createBy},</if>
  56. <if test="createTime != null">#{createTime},</if>
  57. <if test="updateBy != null">#{updateBy},</if>
  58. <if test="updateTime != null">#{updateTime},</if>
  59. <if test="remark != null">#{remark},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateBkDestinationRecordPic" parameterType="BkDestinationRecordPic">
  63. update bk_destination_record_pic
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="destinationRecordId != null">destination_record_id = #{destinationRecordId},</if>
  66. <if test="picAddr != null and picAddr != ''">pic_addr = #{picAddr},</if>
  67. <if test="picNode != null and picNode != ''">pic_node = #{picNode},</if>
  68. <if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
  69. <if test="createBy != null">create_by = #{createBy},</if>
  70. <if test="createTime != null">create_time = #{createTime},</if>
  71. <if test="updateBy != null">update_by = #{updateBy},</if>
  72. <if test="updateTime != null">update_time = #{updateTime},</if>
  73. <if test="remark != null">remark = #{remark},</if>
  74. </trim>
  75. where id = #{id}
  76. </update>
  77. <delete id="deleteBkDestinationRecordPicById" parameterType="Long">
  78. delete from bk_destination_record_pic where id = #{id}
  79. </delete>
  80. <delete id="deleteBkDestinationRecordPicByIds" parameterType="String">
  81. delete from bk_destination_record_pic where id in
  82. <foreach item="id" collection="array" open="(" separator="," close=")">
  83. #{id}
  84. </foreach>
  85. </delete>
  86. </mapper>