1. <insert id="insertSelective" parameterType="com.chinaap.enough.report.v1.pojo.TbEreportCategory" useGeneratedKeys="true" keyProperty="ereportCategoryId" keyColumn="ereport_category_id">
    2. insert into tb_ereport_category
    3. <trim prefix="(" suffix=")" suffixOverrides=",">
    4. <if test="ereportCategoryId != null">
    5. ereport_category_id,
    6. </if>
    7. <if test="createTime != null">
    8. create_time,
    9. </if>
    10. <if test="createName != null">
    11. create_name,
    12. </if>
    13. <if test="createId != null">
    14. create_id,
    15. </if>
    16. <if test="parentId != null">
    17. parent_id,
    18. </if>
    19. <if test="categoryName != null">
    20. category_name,
    21. </if>
    22. <if test="categorySort != null">
    23. category_sort,
    24. </if>
    25. <if test="customerName != null">
    26. customer_name,
    27. </if>
    28. <if test="customerCode != null">
    29. customer_code,
    30. </if>
    31. <if test="isDeleted != null">
    32. is_deleted,
    33. </if>
    34. <if test="modifiedId != null">
    35. modified_id,
    36. </if>
    37. <if test="modifiedName != null">
    38. modified_name,
    39. </if>
    40. <if test="lastModifiedTime != null">
    41. last_modified_time,
    42. </if>
    43. </trim>
    44. <trim prefix="values (" suffix=")" suffixOverrides=",">
    45. <if test="ereportCategoryId != null">
    46. #{ereportCategoryId,jdbcType=BIGINT},
    47. </if>
    48. <if test="createTime != null">
    49. #{createTime,jdbcType=TIMESTAMP},
    50. </if>
    51. <if test="createName != null">
    52. #{createName,jdbcType=VARCHAR},
    53. </if>
    54. <if test="createId != null">
    55. #{createId,jdbcType=BIGINT},
    56. </if>
    57. <if test="parentId != null">
    58. #{parentId,jdbcType=BIGINT},
    59. </if>
    60. <if test="categoryName != null">
    61. #{categoryName,jdbcType=VARCHAR},
    62. </if>
    63. <if test="categorySort != null">
    64. #{categorySort,jdbcType=INTEGER},
    65. </if>
    66. <if test="customerName != null">
    67. #{customerName,jdbcType=VARCHAR},
    68. </if>
    69. <if test="customerCode != null">
    70. #{customerCode,jdbcType=CHAR},
    71. </if>
    72. <if test="isDeleted != null">
    73. #{isDeleted,jdbcType=TINYINT},
    74. </if>
    75. <if test="modifiedId != null">
    76. #{modifiedId,jdbcType=BIGINT},
    77. </if>
    78. <if test="modifiedName != null">
    79. #{modifiedName,jdbcType=VARCHAR},
    80. </if>
    81. <if test="lastModifiedTime != null">
    82. #{lastModifiedTime,jdbcType=TIMESTAMP},
    83. </if>
    84. </trim>
    85. </insert>
    86. useGeneratedKeys="true" //设置为true
    87. keyProperty="ereportCategoryId" //实体中对应字段名
    88. keyColumn="ereport_category_id" //数据库中对应字段名