下面这两种情况,不知道这个if应该怎么写? 请教各位。 有3个参数${month}开始月,${month1}结束月,${year}年份 1、如果 ${month1} = 12,那么【select pk_psndoc,f_1,f_190,f_31,f_39,f_40,f_41,f_42,f_43,f_44,f_45 from wa_data a where a.cperiod between '${month}'and '12' and a.cyear = '${year}'and pk_wa_class ='1001A11000000000155V' union select pk_psndoc,f_1,f_190,f_31,f_39,f_40,f_41,f_42,f_43,f_44,f_45 from wa_data a where a.cperiod between '${month}'and '12' and a.cyear = '${year}'and pk_wa_class ='1001A11000000000436F' union select pk_psndoc,f_1,f_190,f_31,f_39,f_40,f_41,f_42,f_43,f_44,f_45 from wa_data a where a.cperiod = '01' and a.cyear = '${year}'+1 and pk_wa_class ='1001A11000000000153U' union select pk_psndoc,f_1,f_190,f_31,f_39,f_40,f_41,f_42,f_43,f_44,f_45 from wa_data a where a.cperiod = '01' and a.cyear = '${year}'+1 and pk_wa_class ='1001A11000000000155V 】
2、如果${month1}<>12,那么【select pk_psndoc,f_1,f_190,f_31,f_39,f_40,f_41,f_42,f_43,f_44,f_45 from wa_data a where a.cperiod between '${month}'and '${month1}' and a.cyear = '${month}' and pk_wa_class ='1001A11000000000155V' union select pk_psndoc,f_1,f_190,f_31,f_39,f_40,f_41,f_42,f_43,f_44,f_45 from wa_data a where a.cperiod between '${month}'and '${month1}' and a.cyear = '${year}' and pk_wa_class ='1001A11000000000436F'】 |