GoafChecklistItemMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.goaf.mapper.GoafChecklistItemMapper">
  5. <resultMap id="GoafChecklistItemMapper" type="com.zhyc.xps.goaf.entity.GoafChecklistItem">
  6. <id column="checklist_item_id" property="checklistItemId" jdbcType="BIGINT"/>
  7. <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
  8. <result column="checklist_item_content" property="checklistItemContent" jdbcType="VARCHAR"/>
  9. </resultMap>
  10. <select id="getChecklistItemById" resultMap="GoafChecklistItemMapper">
  11. SELECT checklist_item_id,
  12. checklist_item_content
  13. FROM goaf_checklist_item
  14. WHERE checklist_id = #{checklistId ,jdbcType=BIGINT}
  15. </select>
  16. <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafChecklistItem">
  17. insert into goaf_checklist_item
  18. <trim prefix="(" suffix=")" suffixOverrides=",">
  19. <if test="checklistItemId != null">
  20. checklist_item_id,
  21. </if>
  22. <if test="checklistId != null">
  23. checklist_id,
  24. </if>
  25. <if test="checklistItemContent != null and checklistItemContent != ''">
  26. checklist_item_content,
  27. </if>
  28. </trim>
  29. <trim prefix="values (" suffix=")" suffixOverrides=",">
  30. <if test="checklistItemId != null">
  31. #{checklistItemId, jdbcType=BIGINT},
  32. </if>
  33. <if test="checklistId != null">
  34. #{checklistId, jdbcType=BIGINT},
  35. </if>
  36. <if test="checklistItemContent != null and checklistItemContent != ''">
  37. #{checklistItemContent, jdbcType=VARCHAR},
  38. </if>
  39. </trim>
  40. </insert>
  41. <!--Update更新-->
  42. <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafChecklistItem">
  43. UPDATE goaf_checklist_item
  44. <trim suffixOverrides=",">
  45. <set>
  46. <if test="checklistItemContent != null and checklistItemContent != ''">
  47. checklist_item_content = #{checklistItemContent, jdbcType=VARCHAR},
  48. </if>
  49. </set>
  50. </trim>
  51. WHERE checklist_item_id = #{checklistItemId, jdbcType=BIGINT}
  52. </update>
  53. <delete id="delete" >
  54. DELETE FROM goaf_checklist_item
  55. WHERE checklist_item_id = #{checklistItemId, jdbcType=BIGINT, jdbcType=BIGINT}
  56. </delete>
  57. <delete id="deleteAll" >
  58. DELETE FROM goaf_checklist_item
  59. WHERE checklist_id = #{checklistId, jdbcType=BIGINT, jdbcType=BIGINT}
  60. </delete>
  61. </mapper>