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