<?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. WinForm窗体继承

    在Windows应用程序中,从现有的窗体继承,查看子窗体的设计视图时,会出现错误: 服务容器中已存在服务 System.Windows.Forms.Design.IEventHandlerServic ...

  2. 自然语言交流系统 phxnet团队 创新实训 项目博客 (十)

      关于本项目中使用到的庖丁分词的总结:   Paoding 详细介绍 庖丁中文分词库是一个使用Java开发的,可结合到Lucene应用中的,为互联网.企业内部网使用的中文搜索引擎分词组件.Paodi ...

  3. idea+maven无法自动加载jar包

    没有配置maven的环境变量所致 执行mvn -version进行检测

  4. 关于Unity中的旋涡特效的制作(捕鱼达人3技术)(专题八)

    Mesh--材质--Shader 1: Mesh 是网格,包括顶点,法线,纹理坐标,切线,三角形.在每一个3D模型节点里面,有一个Mesh Filter组件来提取模型里面的网格数据;2: Shader ...

  5. ABAP--如何创建自定义打印条码

    ABAP--如何创建自定义打印条码 BARCODE in Smartforms: How to create customize BARCODE for Smartforms. 1 Introduct ...

  6. 【转】【WPF】WPF为stackpanel设置滚动条

    <ScrollViewer x:Name="scrolls" VerticalScrollBarVisibility="Auto" HorizontalS ...

  7. linux下压缩与打包工具——gzip, bzip2 和 tar;

    以下内容来自:阿铭http://www.apelearn.com/study_v2/chapter11.html, 把常用的写出来了:感觉可以了: 只管压缩与解压缩的工具: gzip 工具: 用的时候 ...

  8. [ACM] POJ 1611 The Suspects (并查集,输出第i个人所在集合的总人数)

    The Suspects Time Limit: 1000MS   Memory Limit: 20000K Total Submissions: 21586   Accepted: 10456 De ...

  9. List转DataTable(反射) ; 将泛型集合类转换成DataTable ; 将集合类转换成DataTable

    public class ConvertX { #region 将集合类转换成DataTable /// <summary> /// 将集合类转换成DataTable /// </s ...

  10. windows server 安装phpVirtualBox web服务

    这是我在Windows server 2012 下的安装过程 (1) 安装virtualbox (2) 安装IIS和PHP, 参考: https://msdn.microsoft.com/zh-cn/ ...