Database design for internal mail management and batch processing of DWZ

Source: Internet
Author: User

DWZ Framework Learning Notes (vii)Haven't written a blog for a long time, recently arranged to do internal mail management module, to do before the design of a database, but also on the Internet to find 163 mailbox database design, although to do not have 163 of the complex mailbox, but its data design is still a reference. A total of three sheets are required: Letter form, collection form and attachment table. The relationship of the three is the relationship between the letter form and the collection table 1 to n, the letter table and the attachment table are also 1 pairs of n relationship. When storing, you will find a problem, because the ID of the letter table is self-growth, when you want to store the pickup information to the collection table, you need to store the sender information just stored a record ID, the question is how to get the data from the growth ID, when encountering this problem, because have not encountered before, and learn the database also did not think about this problem, that only Baidu, (database used to be MySQL) Baidu found that MySQL has a last_insert_id () method, the database just insert a piece of data, this method can be obtained from the growth ID, Want to know this method can go to find data, but for me this method is not possible, because when I finished inserting the letter table data, in the execution of this method does not get the last Insert data ID, may be the underlying design problem, so only the second method, before inserting the data to query the maximum ID number of the data, It's a bad idea, but it's the only way. (later learned that the bottom has been written a way to get self-growth, is not very dizzy death) This isInbox interface, is not very ugly ah, for this I am also very helpless, DWZ frame no bootstrap as Fancy button, mail status picture is in http://www.iconpng.com/search/icon= Mail icon/7, this site icon is still very rich, Hope to find the icon you need. Here I encountered batch processing problem, how to put the number of selected records in front of the ID to the background. <th width= "><input" type= "checkbox" group= "IDs" class= "Checkboxctrl" ></th>
<td><input name= "IDs" value= "${sendmailinfo.send_mail_id}" type= "checkbox" ></td>
The above code is written according to the case of the DWZ framework, the only difference is that the button for batch processing is different, the code is as follows: <li><a class= "Delete" target= "Selectedtodo" rel= "IDs" Posttype = ' string ' href= "<c:url value= '/management/internalmail/sendmail/moredelete.htm '/>" title= "Are you sure you want to delete it?" ><span> Delete </span></a></li>
Different place is more posttype = ' string ' This, in the background as long as the IDs this, the ID in the format of the one-in-a-kind assignment to IDs. Backstage in the second passlist<string> list = stringutils.getsplitstringtolist (IDs, ",");
for (int i = 0; i < list.size (); i++) {
String id = list.get (i). toString ();
Change a message to read
Receivemailservice.changefalgdele (ID);
}
Stores information in a database. (Spring MVC)Finally, the main solution is to solve two problems: 1. How to get the database self-growth id;2.dwz How to get the ID value of the batch processing data. (internal mail Management Design Table document: http://download.csdn.net/detail/u012157999/8746079)

Database design for internal mail management and batch processing of DWZ

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.