48 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			48 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C#
		
	
	
	
|  |  | |||
|  | /// <summary> | |||
|  | ///INTERFACE IMPLIMENT FOR TABLE t_PublicNews | |||
|  | ///By wm with codesmith.  | |||
|  | ///on 04/18/2017 | |||
|  | /// </summary> | |||
|  | 
 | |||
|  | using System; | |||
|  | using System.Data.SqlClient;  | |||
|  | namespace DeiNiu.wms.Data.Model | |||
|  | { | |||
|  |     [Serializable]  class PublicNews_Imp : PublicNews_base_Imp | |||
|  |     {  | |||
|  |         protected override void CmdPrepare(SqlCommand sqlCmd) | |||
|  |         {  | |||
|  |             base.CmdPrepare(sqlCmd); | |||
|  |             PublicNews _Obj = (PublicNews)modelObj; | |||
|  |             switch (_cust_op_flag) | |||
|  |             { | |||
|  | 
 | |||
|  |                 case 100:  //by auth | |||
|  |                     _strSql = "SELECT * FROM T_PUBLICNEWS WHERE news_authority = @AUTH order by create_time desc"; | |||
|  |                     sqlCmd.CommandText = _strSql; | |||
|  |                     sqlCmd.Parameters.AddWithValue("@AUTH", _Obj.CmdParameters[0]); | |||
|  |                     break; | |||
|  | 
 | |||
|  |                 case 200:  //by auth | |||
|  |                     _strSql = | |||
|  |                         "select * from t_authority a where dr=1 and auth_publicinfomation=1 and auth_marqueen=0 and exists(select 1 from  t_authority b where dr=1 and auth_uplevel =0 and id = a.auth_uplevel) order by auth_uplevel"; | |||
|  | 
 | |||
|  |                     sqlCmd.CommandText = _strSql; | |||
|  | 
 | |||
|  |                     break; | |||
|  | 
 | |||
|  |                 case 300:  //跑马灯廉政警句 | |||
|  |                     _strSql = | |||
|  |                         "select * from T_PUBLICNEWS where dr=1 and news_authority in " | |||
|  |                           + "(select id from t_authority a where dr=1 and auth_publicinfomation=1 and auth_marqueen=1 ) "; | |||
|  | 
 | |||
|  |                     sqlCmd.CommandText = _strSql; | |||
|  | 
 | |||
|  |                     break; | |||
|  |      | |||
|  |                   | |||
|  |             } | |||
|  |         } | |||
|  |     } | |||
|  | } |