mysqlmapper中增删查改

出门莫恨无人随,书中车马多如簇。这篇文章主要讲述mysqlmapper中增删查改相关的知识,希望能为你提供帮助。
 
//1.增
public int insert(Port port) ;
//2.删
public int deleteM(String id);
//3.改
public int update(Port port);
//1.增
< insert id="insert" parameterType="com.cn.eport.pojo.Port" resultType="integer">
INSERT INTO bas_port (
id,
country_id,
region_id,
NAME,
is_lock,
add_by,
add_time,
update_by,
update_time
)
VALUES
(
#{id},#{country_id},#{region_id},#{name},#{is_lock},#{add_by},#{add_time},#{update_by},#{update_time})

< /insert>
//2.删
< delete id="deleteM"  resultType="integer" >
DELETE
FROM
pro_mainfest
WHERE
id = #{id}
< /delete>
 
 
//3.改
< update id="update" parameterType="com.cn.eport.pojo.Port" resultType="integer">
UPDATE bas_port
SET id = #{id},country_id=#{country_id},
region_id = #{region_id},name=#{name},is_lock=#{is_lock},
add_by = #{add_by},add_time=#{add_time},update_by=#{update_by},update_by=#{update_by}
WHERE
id = #{id}
< /update>
 
//4.mysql数据库分页查询
【mysqlmapper中增删查改】limit x,y      x开始行数    y总行数        集合意义(x, x+y)






























    推荐阅读