<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="ProductList">
    <typeAlias alias="productList" type="com.founder.ec.goods_no.ProductList"/>

    <typeAlias alias="goodsnos" type="com.founder.ec.goods_no.Goods"/>

    <resultMap class="goodsnos" id="goodsMap">
        <result column="GOODS_ID" property="goodsID"  />
        <result column="GOODS_NO" property="goodsNo" />
        <result column="PRODUCT_ID" property="productID" />
        <result column="GOODS_NAME" property="goodsName" />
        <result column="GOODS_DESC" property="goodsDesc" />
        <result column="STOCK_ID" property="stockID" />
        <result column="SUPPLY_ID" property="supplyID" />
        <result column="GOOD_STOCK" property="goodStock"  />
        <result column="PREPARE_STOCK" property="prepareStock" />
        <result column="LOCK_STOCK" property="lockStock"/>
        <result column="AVAILABLE_STOCK" property="availableStock" />
        <result column="COST_PRICE" property="costPrice"/>
        <result column="EC_PRICE" property="ecPrice"  />
        <result column="MARKET_PRICE" property="marketPrice" />
        <result column="BAR_CODE" property="barCode"  />
        <result column="DOUBLE_BAR_CODE" property="doubleBarCode"  />
        <result column="WEIGHT" property="weight"  />
        <result column="VOLUME" property="volume" />
        <result column="IS_DEFAULT" property="isDefault" />
        <result column="FREIGHT_TYPE" property="freightType"  />
        <result column="GOODS_MANUFACTURE_DATE" property="goodsManufactureDate" />
        <result column="PACKAGE_STANDARD" property="packageStandard"  />
        <result property="productName" column="PRODUCT_NAME"/>
        <result property="goodsUnit" column="UNIT_NAME"/>
        <result property="productCode" column="PRODUCT_CODE"/>
        <result property="proCatalogId" column="PRO_CATALOG_ID"/>
    </resultMap>

    <resultMap class="productList" id="productSimpleListMap">
    <result column="PRODUCT_ID" property="productID"/>
    <result column="PRODUCT_CODE"  property="productCode"/>
    <result column="PRODUCT_NAME"  property="productName"/>
    <result column="PRODUCT_COMMON_NAME"  property="productCommonName"/>
    <result column="PRODUCT_ALIAS_NAME"  property="productAliasName"/>
    <result column="PRODUCT_CHN_NO"  property="productChnNo"/>
    <result column="PRODUCT_ORDER"  property="productOrder"/>
    <result column="PRO_CATALOG_ID"  property="proCatalogID"/>
    <result column="PRODUCT_POINT"  property="productPoint"/>
    <result column="IS_SUPPORT_POINT"  property="isSupportPoint"/>
    <result column="PRODUCT_BRAND_ID"  property="productBrandID"/>
    <result column="DRUG_APPROVE_TYPE"  property="drugApproveType"/>
    <result column="DRUG_APPROVE_NO"  property="drugApproveNo"/>
    <result column="DRUG_TREATMENT"  property="drugTreatment"/>
    <result column="DRUG_COMPOSITION"  property="drugComposition"/>
    <result column="DRUG_TYPE"  property="drugType"/>
    <result column="DRUG_PRESCRIPTION_TYPE"  property="drugPrescriptionType"/>
    <result column="PRODUCT_TYPE_ID"  property="productTypeID"/>
    <result column="PRODUCT_KEYWORD"  property="productKeyword"/>
    <result column="PRODUCT_DESC"  property="productDesc"/>
    <result column="UNIT_ID"  property="unitID"/>
    <result column="PRODUCT_LOCALITY"  property="productLocality"/>
    <result column="PRODUCER" property="producer"/>
    <result column="QUALITY_LIMIT"  property="qualityLimit"/>
    <result column="PRODUCT_MARKET_DATE"  property="productMarketDate"/>
    <result column="IS_ONSALE"  property="isOnsale"/>
    <result column="ONSALE_TIME"  property="onsaleTime"/>
    <result column="PRODUCT_LEAST_ORDER" property="productLeastOrder"/>
    <result column="ORDER_LIMIT_AMOUNT" property="orderLimitAmount"/>
    <result column="IS_STOCK_WARN"  property="isStockWarn"/>
    <result column="PRODUCT_WARN_NUMBER" property="productWarnNumber"/>
    <result column="CATALOG_CODE"  property="catalogCode"/>
    <result column="goods_seller"  property="goodsSeller"/>
    <result column="stock_id"  property="stockNo"/>

    </resultMap>
    <!--   通过商品编码查询满足海外的商品

    <select id="getGoodsByGoodsNoImport"
            parameterClass="java.lang.String">
       select  * from goods g
          left join
           stock s
             on g.STOCK_ID=s.STOCK_ID
          LEFT  join
            GOODS_SELLER gs
             on gs.goods_seller_id=s.goods_seller_id
          LEFT JOIN
          PRODUCT p
             on g.GOODS_NO=p.PRODUCT_CODE
                  where
                     gs.IS_ABROAD='Y' AND gs.IS_DELETE='N'
                       AND G.IS_DELETE='N'
                           and g.goods_no=#goodsNo#
    </select>

-->
    <!--   通过商品编码查询productId

    <select id="getProductIdByGoodsNo"
            parameterClass="ProductList">
        select   * from product p where p.PRODUCT_ID=125858
        and g.goods_no=#goodsNo#
    </select>
 -->
    <!-- 编辑 product更新 -->
    <update id="updateImportProductList"  parameterClass="productList">
        update product
        <dynamic prepend="set">
            <isNotEmpty prepend="," property="editUserId">
                <![CDATA[ EDIT_USER_ID=#editUserId# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="addUserId">
                <![CDATA[ ADD_USER_ID=#addUserId# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="editTime">
                <![CDATA[ EDIT_TIME=#editTime# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="productName">
                <![CDATA[ product_name=#productName# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="productLeastOrder">
                <![CDATA[ product_least_order=#productLeastOrder# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="productLimitAmount">
                <![CDATA[ product_limit_amount=#productLimitAmount# ]]>
            </isNotEmpty>

        </dynamic>
        where PRODUCT_CODE=#productCode#
    </update>

<!-- goods表-->
    <update id="updateImportGoods" parameterClass="goods">
        update goods
        <dynamic prepend="set">
            <isNotEmpty prepend="," property="editUserId">
                <![CDATA[ EDIT_USER_ID=#editUserId# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="addUserId">
                <![CDATA[ ADD_USER_ID=#addUserId# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="editTime">
                <![CDATA[ EDIT_TIME=#editTime# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="standPackage">
                <![CDATA[ stand_package=#standPackage# ]]>
            </isNotEmpty>

            <isNotEmpty prepend="," property="standPackage">
                <![CDATA[ stand_package=#standPackage# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="weight">
                <![CDATA[ weight=#weight# ]]>
            </isNotEmpty>

            <isNotEmpty prepend="," property="marketPrice">
                <![CDATA[ market_price=#marketPrice# ]]>
            </isNotEmpty>
            <isNotEmpty prepend="," property="ecPrice">
                <![CDATA[ ec_price=#ecPrice# ]]>
            </isNotEmpty>

            <isNotEmpty prepend="," property="availableStock">
                <![CDATA[ available_stock=#availableStock# ]]>
            </isNotEmpty>
        </dynamic>
        where PRODUCT_ID=#productId#
    </update>

</sqlMap>

ibatis 引入多个model的更多相关文章

  1. mybatis 之引入多个model

    配置hessian: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configurati ...

  2. ibatis复用SQL片段、引入片段 动态条件增加

    1:ibatis复用SQL片段.引入片段  使用[sql]和[include]标签: 通常情况下,你会这样写:xml 代码 <select id="selectItemCount&qu ...

  3. ibatis动态查询

    在复杂查询过程中,我们常常需要根据用户的选择决定查询条件,这里发生变化的并不只是SQL 中的参数,包括Select 语句中所包括的字段和限定条件,都可能发生变化.典型情况,如在一个复杂的组合查询页面, ...

  4. Thinkphp 零散知识点(caa/js路径,引入第三方类,ajax返回,session/cookie)

    一.关于JS和CSS路径问题 1.找路径是从入口文件index.php来找的,而不是从文件本身所在位置来找, 因为我们访问时是访问的入口文件 2.在存放JS和CSS的时候可以放到public文件夹下 ...

  5. Scrapy中使用Django的Model访问数据库

    Scrapy中使用Django的Model进行数据库访问 当已存在Django项目的时候,直接引入Django的Model来使用比较简单 # 使用以下语句添加Django项目的目录到path impo ...

  6. vue中import引入模块路径中@符号是什么意思

    在编写vue文件中引入模块 import model from "@/common/model"; 这里路径前面的“@”符号表示什么意思? resolve: { // 自动补全的扩 ...

  7. ibatis Dynamic总结(ibatis使用安全的拼接语句,动态查询)

    ibatis中使用安全的拼接语句,动态查询,ibatis比JDBC的优势之一,安全高效 说明文字在注释中 一.引入 一个小例子  <select id="selectAllProduc ...

  8. Django Model 数据表

    Django Model 定义语法 版本:1.7主要来源:https://docs.djangoproject.com/en/1.7/topics/db/models/ 简单用法 from djang ...

  9. Django Model 定义语法

    简单用法 from django.db import models class Person(models.Model): first_name = models.CharField(max_leng ...

随机推荐

  1. 为什么c++中,有时可以用类名直接访问非静态成员函数?

    正规的C++语言标准目前(截止到C++14)应该还不支持这种调用方法.目前微软似乎在它的VC++中推行一种叫做C++/CLI的标准,有可能会支持这种调用,如果一定要用这种调用方法的话,还应该用VS20 ...

  2. 去掉WIN7 桌面图标的小箭头

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" ...

  3. Java如何暂停线程一段时间?

    在Java编程中,如何暂停线程一段时间? 以下示例显示如何通过创建sleepThread()方法来暂停线程一段时间. package com.yiibai; public class Suspendi ...

  4. e809. 在菜单中使菜单项分开

    A separator typically appears as a horizontal line. It is used to group related sets of menu items i ...

  5. QComboBox:类似于的百度的搜索提示

    参考: http://blog.csdn.net/lingchen214/article/details/17960789 http://blog.sina.com.cn/s/blog_a6fb6cc ...

  6. iOS: 查看 UIView 的视图树

    在想要查看的 UIView 附近打个断点,运行,直到停在断点处,在控制台键入:po [view recursiveDescription],回车. (lldb) po [self recursiveD ...

  7. iOS: crush when save Core Data

    如果一个页面拥有一个 NSFetchedResultsController 的引用,那么在这个界面将要结束时,一定要 remove 它的 observer - (void)dealloc { //.. ...

  8. asp.net导出excel 问题及服务器的部署dcom组件配置

    一.服务器上没有装office 如果要用MS的,这个问题基本不用考虑,只有安装才能解决,没有其它办法! (即使有牛人弄出来 了,估计也是给自己找麻烦) 不过,我只在服务器上装了一个2003精简版, 我 ...

  9. 近阶段学习总结(EasyUI的使用)

    最近阶段正在学习Js框架的使用,目前正在详细了解JQuery EasyUI 的使用. jQuery EasyUI 框架帮助我们轻松建立站点: easyui是一个基于jquery的集成了各种用户界面的插 ...

  10. 录制iPhone屏幕并转成gif方案

    app的开发经常会碰到需要演示一个交互,或者一个bug的情况,通常涉及一连串的操作以及操作的反馈,这是文字,或截图都无法表达的,视频的话还得播放器参与,最好的一个想法应该是录制屏幕然后再转成gif图片 ...