029 Medical Projects-Module III: Pharmaceutical Suppliers Catalog Module--dao Layer: Basic Query statement writing

Source: Internet
Author: User

We install the display requirements:

We can see that the displayed directory contains: The name of the supplier (this data comes from the supplier's Table [Usergys]), the serial number, the generic name, the dosage form (these are all from the drug information sheet), the status of the supply (this is actually a number 1 or 0 in the Gysypml_control, But what we want to show is normal or pause, so this information will find the data dictionary table Dictinfo to achieve this function) ....

So when we look at what we're going to show: The table to be associated with

GYSYPML, Usergys, Gysypml_control, Ypxx,dictinfo, etc.

Let's take a look at the SQL statement:

SelectGysypml.ypxxid, Gysypml.usergysid, USERGYS.MC USERGYSMC, Gysypml_control.control, (SelectInfo fromDictinfowhereTypeCode= '008'            andDictcode=Gysypml_control.control) CONTROLMC, -- here to check the data dictionary, is to show the 0,1 corresponding to the pause, normal.        ypxx.id, YPXX.BM, YPXX.MC, YPXX.JX, Ypxx.gg, Ypxx.zhxs, YPXX.SCQYMC, YPXX.SPMC, YPXX.ZBJG, Ypxx.jyzt, (SelectInfo fromDictinfowhereYpxx.jyzt=Dictcode andTypeCode= '003') JYZTMC fromgysypml, Usergys, Gysypml_control, YpxxwhereGysypml.usergysid=usergys.id andGysypml.ypxxid=Gysypml_control.ypxxid andGysypml.usergysid=Gysypml_control.usergysid andGysypml.ypxxid=ypxx.id--Data scope permissions, this function is a drug supplier can only see their own drugs can not see other people's medicine, so to pass a supplier ID, this ID is from the action layer to the service layer to the DAO layer.     andGysypml.usergysid= '5197cdd2-08cf-11e3-8a4f-60a44cea4388'

Our SQL statement is finished here.

029 Medical Projects-Module III: Pharmaceutical Suppliers Catalog Module--dao Layer: Basic Query statement writing

Related Article

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.