• mybatis的sqlprovider用法扩展自定义sql


    SqlProvider使用
    public class MemberRewardSqlProvider {
        private static final Logger log = LoggerFactory.getLogger(EappShpstoreSqlProvider.class);
    
        public String selectByPage(MemberReward memberReward) {
            StringBuffer sb = new StringBuffer();
            sb.append("select * from member_reward where 1=1 and status != 'D'");
            if(memberReward.getShopstoreId() != null){
                sb.append(" and shopstore_id = "+memberReward.getShopstoreId());
            }
            log.debug("selectByPage:" + sb.toString());
            return sb.toString();
        }
    }
    public interface XXXXMapper{
        @SelectProvider(type = MemberRewardSqlProvider.class, method = "selectByPage")
        List<MemberReward> selectByPage(MemberReward memberReward, PageBounds pageBounds);
    }
    

      

  • 相关阅读:
    Next Permutation
    SpringMVC配置信息
    Servlet详解(转载)
    Length of Last Word
    Maximum Subarray**
    Divide Two Integers
    Generate Parentheses***
    http解码-2
    编码-1
    扫描工具对比
  • 原文地址:https://www.cnblogs.com/qinyios/p/11124747.html
Copyright © 2020-2023  润新知