<insert id="insertSelective" parameterType="com.chinaap.enough.report.v1.pojo.TbEreportCategory" useGeneratedKeys="true" keyProperty="ereportCategoryId" keyColumn="ereport_category_id">insert into tb_ereport_category<trim prefix="(" suffix=")" suffixOverrides=","><if test="ereportCategoryId != null">ereport_category_id,</if><if test="createTime != null">create_time,</if><if test="createName != null">create_name,</if><if test="createId != null">create_id,</if><if test="parentId != null">parent_id,</if><if test="categoryName != null">category_name,</if><if test="categorySort != null">category_sort,</if><if test="customerName != null">customer_name,</if><if test="customerCode != null">customer_code,</if><if test="isDeleted != null">is_deleted,</if><if test="modifiedId != null">modified_id,</if><if test="modifiedName != null">modified_name,</if><if test="lastModifiedTime != null">last_modified_time,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="ereportCategoryId != null">#{ereportCategoryId,jdbcType=BIGINT},</if><if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if><if test="createName != null">#{createName,jdbcType=VARCHAR},</if><if test="createId != null">#{createId,jdbcType=BIGINT},</if><if test="parentId != null">#{parentId,jdbcType=BIGINT},</if><if test="categoryName != null">#{categoryName,jdbcType=VARCHAR},</if><if test="categorySort != null">#{categorySort,jdbcType=INTEGER},</if><if test="customerName != null">#{customerName,jdbcType=VARCHAR},</if><if test="customerCode != null">#{customerCode,jdbcType=CHAR},</if><if test="isDeleted != null">#{isDeleted,jdbcType=TINYINT},</if><if test="modifiedId != null">#{modifiedId,jdbcType=BIGINT},</if><if test="modifiedName != null">#{modifiedName,jdbcType=VARCHAR},</if><if test="lastModifiedTime != null">#{lastModifiedTime,jdbcType=TIMESTAMP},</if></trim></insert>useGeneratedKeys="true" //设置为truekeyProperty="ereportCategoryId" //实体中对应字段名keyColumn="ereport_category_id" //数据库中对应字段名
