Mybatis+mysql returns the inserted primary key, and the parameter only provides a partial parameter
<id= "Insertbychannelidopenid" usegeneratedkeys= "true" Keyproperty = "id" parametertype= "Com.model.StatisticSaler"> INSERT INTO Statistic_saler (city_id,shop_id,saler_id,type,openid,time) Select City_id,shop_id,saler_id,#{type,jdbctype =varchar},#{openid,jdbctype=varchar},now () from channel s where s.id = #{id,jdbctype=integer} </Insert>
The input parameters provide only partial parameters, and other database tables are used during the insertion process;
MyBatis This INSERT statement returns the number of record bars that are affected;
The object that is used as a parameter is
Usegeneratedkeys= "true" keyproperty= "id"
and obtain the ID of the new record;
Mybatis+mysql returns the inserted primary key, and the parameter only provides a partial parameter