searchFestival
===
SELECT @pageTag(){
		b.id, b.fescod, b.fesname, lower(conv(fescod, 10, 32)) fes, b.url, b.title, b.stime1 stime, b.etime1 etime, b.paritycode, b.allchannel, inserttime, updatetime
    @}

FROM (select b1.*, if(b1.stime='0000-00-00', null, b1.stime) stime1, 
                  if(b1.etime='0000-00-00', null, b1.etime) etime1 
     from tb_ordercenter_festival b1) b

where 1=1

@if(!isEmpty(title)){
    and b.title like #'%'+title+'%'#
@}

@if(!isEmpty(fesname)){
    and b.fesname like #'%'+fesname+'%'#
@}

@if(!isEmpty(fes)){
    and b.fescod = conv(fes, 32, 10)
@}

@if(!isEmpty(url)){
    and b.url like #'%'+url+'%'#
@}
order by CONVERT(b.fescod, signed) asc

findAllFestival
===
select b1.*, lower(conv(fescod, 10, 32)) fes, 
        if(b1.stime='0000-00-00', null, b1.stime) stime1, 
        if(b1.etime='0000-00-00', null, b1.etime) etime1 
  from tb_ordercenter_festival b1 
 order by CONVERT(fescod, signed) asc

saveFestival
===
insert into tb_ordercenter_festival(id, fescod, fesname, title, url, stime, etime, paritycode, allchannel) 
select max(id) + 1, max(fescod) + 1, #fesname#, #title#, #url#, #stime#, #etime#, #paritycode#, #allchannel#
from tb_ordercenter_festival 

updateFestival
===
update tb_ordercenter_festival
set fesname=#fesname#,
    title=#title#,
    url=#url#,
    stime=#stime#,
    etime=#etime#,
    paritycode=#paritycode#,
    allchannel=#allchannel#
where id=#id#

findById
===
select id, fescod, fesname, title, url, stime, etime, inserttime, updatetime, lower(conv(fescod, 10, 32)) fes, paritycode, allchannel
from tb_ordercenter_festival
where id = #id#

findByFescod
===
select id, fescod, fesname, title, url, stime, etime, inserttime, updatetime, lower(conv(fescod, 10, 32)) fes, paritycode, allchannel
from tb_ordercenter_festival
where fescod = #fescod#

deleteFesAndChannel
===
delete from tb_ordercenter_festival 
where fescod=#fescod#