zoukankan      html  css  js  c++  java
  • mybetis中的代理模式

    //mybetis中的配置

    <mappers>
    <mapper resource="cn/hd/sale/mapper/SalesbeanMapper.xml"/>

    </mappers>

    //如果对象类中的属性字段和数据库中的字段不是一致的时候,一定要用resultMap将他们一一对应起来,否则就算是中日志中取到了值也不能在代理类的Mapping中取到值

    <select id="pageModel" parameterType="cn.hd.sale.po.Salesbean" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from crm_sales
    <where>
    <if test="sCustName!=null and sCustName!=''">
    and s_cust_name like #{sCustName}
    </if>
    <if test="sOutline!=null and sOutline!=''">
    and s_outline like #{sOutline}
    </if>
    <if test="sContatcs!=null and sContatcs!=''">
    and s_contatcs like #{sContatcs}
    </if>
    </where>

    </select>

    <resultMap id="BaseResultMap" type="cn.hd.sale.po.Salesbean">
    <!-- WARNING - @mbggenerated This element is automatically generated by
    MyBatis Generator, do not modify. This element was generated on Thu Dec 01
    14:05:57 CST 2016. -->
    <id column="s_id" property="sId" jdbcType="INTEGER" />
    <result column="s_sale_no" property="sSaleNo" jdbcType="INTEGER" />
    <result column="s_cust_name" property="sCustName" jdbcType="VARCHAR" />
    <result column="s_outline" property="sOutline" jdbcType="VARCHAR" />
    <result column="s_contatcs" property="sContatcs" jdbcType="VARCHAR" />
    <result column="s_contatcs_phone" property="sContatcsPhone"
    jdbcType="VARCHAR" />
    <result column="s_create_time" property="sCreateTime" jdbcType="DATE" />
    <result column="s_creater" property="sCreater" jdbcType="VARCHAR" />
    <result column="s_opp_src" property="sOppSrc" jdbcType="VARCHAR" />
    <result column="s_succodds" property="sSuccodds" jdbcType="VARCHAR" />
    <result column="s_describe" property="sDescribe" jdbcType="VARCHAR" />
    <result column="s_assgin" property="sAssgin" jdbcType="VARCHAR" />
    <result column="s_assgin_time" property="sAssginTime" jdbcType="DATE" />
    </resultMap>

  • 相关阅读:
    怎么制作html5网站页面让它适应电脑和手机的尺寸
    js面向对象 下
    认识面向对象及代码示例
    Math 对象
    js事件驱动函数
    模拟js中注册表单验证
    敏感词过滤 简单 模仿
    模仿随机验证码-简单效果
    字符串方法(函数)
    js中字符串概念
  • 原文地址:https://www.cnblogs.com/joyous-day/p/6128256.html
Copyright © 2011-2022 走看看