代码示例:下面是用的mybatis自动生成的sql语句 ,紫色部分是需要加的代码,其中绿色部分是数据库的主键,如果主键是 item_id 则绿色部分写成itemId
<insert id="insertSelective" parameterType="com.rtkj.rterp.web.model.depot.DepotPushRule" useGeneratedKeys="true" keyProperty="id" >
insert into depot_push_rule<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="ruleId != null" >
rule_id,
</if>
<if test="ruleName != null" >
rule_name,
</if>
<if test="disabled !