public static List <TicketModel> GetList(string status) { using (var db = new MySqlDapperHelper()) { string sql = @" SELECT A.ticket_id ,A.title ,A.status FROM t_ticket A WHERE A.status = @status "; return(db.Query <TicketModel>(sql, new { status = status })); } }
public static List <BoardModel> GetList(string search) { using (var db = new MySqlDapperHelper()) { string sql = @" SELECT A.idx ,A.title ,A.reg_user ,A.reg_username ,A.reg_date ,A.view_Cnt ,A.status_flag FROM t_board A WHERE A.title LIKE CONCAT('%', IFNULL(@search, ''), '%') ORDER BY A.idx DESC "; return(db.Query <BoardModel>(sql, new { search = search })); } }