当前位置:网站首页>Final summary of addition, deletion, modification and query - 2.1 (single table - addition, deletion, modification and query)

Final summary of addition, deletion, modification and query - 2.1 (single table - addition, deletion, modification and query)

2022-06-12 03:03:00 Men should be calm, boiling water will only evaporate

One 、 increase insert( New data / Put in storage )


       1、 law


All are The user submits in the browser form The form data Encapsulated in the js Object to pass parameters , stay controller Layer connection (user) The object is connected to
Be careful :1、sql The statement did not where Conditions ( New data none id, Only after the addition is completed id You can use )
           2、 No return value ,service Layer without return


        2、 Different frame writing

Multiple where Conditions :controller Layer encapsulates it as an object (user) coming



               1)mybatis frame


service Layer interface

void saveUser(User user);

service Layer interface implementation class

 @Override
    public void saveUser(User user) {
            user.setPassword(md5Pass)
                .setStatus(true)
                .setCreated(date)
                .setUpdated(date);
        userMapper.saveUser(user);
    }

               1> How to write the mapping file

mapper Layer interface

原网站

版权声明
本文为[Men should be calm, boiling water will only evaporate]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203011114258203.html