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>

  • 相关阅读:
    POJ2686 Traveling by Stagecoach(状压DP+SPFA)
    POJ3250 Bad Hair Day(单调栈)
    POJ3493 Largest Submatrix of All 1’s(单调栈)
    UVA 10160 Servicing Stations(状态压缩+迭代加深)
    POJ 2187 Beauty Contest
    HDU 6017 Girls Love 233(多态继承DP)
    POJ 2932 Coneology(扫描线)
    POJ 1127 Jack Straws (计算几何)
    挑战程序设计竞赛 3.5 借助水流解决问题的网络流
    AOJ 2230 How to Create a Good Game(费用流)
  • 原文地址:https://www.cnblogs.com/joyous-day/p/6128256.html
Copyright © 2011-2022 走看看