MySQL mapper additions and deletions in the search and change

Source: Internet
Author: User

1. Increase
public int Insert (port port);

2. By deleting

public int deletem (String ID);
3. Change
public int update (port port);

1. Increase

<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. By deleting

<delete id= "Deletem" resulttype="integer" >
DELETE
From
Pro_mainfest
WHERE
id = #{id}
</delete>

3. Change
<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 Database Paging Query

Limit x, y x start rows y Total row number set meaning (x, x+y)

MySQL mapper additions and deletions in the search and change

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.