常用IBatis属性
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="GoodDetail" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<resultMaps> <!--店铺商品列表实体类映射-->
<resultMap id="ShopSaleGoodsListVMMap" class="Goods.SPI.ShopSaleGoodsListVM">
<result property="ID" column="Good_ID"/>
<result property="Name" column="Good_Name"/>
<result property="GoodsState" column="Good_State"/>
<result property="TypeID" column="Good_Type" />
<result property="ShopName" column="GS_Name"/>
<result property="ShopState" column="GS_State"/>
<result property="GbpvList" column="GoodsID=Good_ID,ShopID=Good_ShopID,CityID=CityID,ShowType=ShowType,SaleType=SaleType,CombineType=CombineType" select="GetShopGoodsGbpvListForInclude"/>
</resultMap> </resultMaps> <statements> <!--查询店铺可售的商品列表-->
<select id="GetShopGoodsGbpvList" resultMap="ShopSaleGoodsListVMMap" parameterClass="Goods.SPI.GetShopGoodsGbpvInfoListDto"> select * from (
select ROW_NUMBER() Over(order by Good_Order desc) as row_num,
Good_ID,Good_Type,Good_Name,Good_State, Good_Order,Good_RootTypeID,Good_ShopID
,'' GS_Name,'' GS_State,#ShowType# ShowType,#SaleType# SaleType,#CombineType# CombineType,isnull(#CityID#,'') CityID
from goodtable a with(nolock)
inner join goodDetailTable b with(nolock)
on GDI_ID=Good_DefaultGDIID and Good_SaleType='1' and Good_State='2' and b.DelFlag='0' and a.DelFlag='0'
where Good_ShopID=#ShopID# and Good_SaleType='1' and Good_State='2' and a.Delflag='0'
<isNotEmpty prepend="and" property="GoodsTypeArr">
Good_Type in
<iterate open=" (" close=") " conjunction="," property="GoodsTypeArr" >
#GoodsTypeArr[]#
</iterate>
</isNotEmpty>
and exists (select 1 from goodPropertyTable with(nolock) where GBPV_GoodID=Good_ID <isNotEmpty prepend=" " property="SaleType">
and GBPV_SaleType=#SaleType#
</isNotEmpty>
<isNotEmpty prepend=" " property="ShowType">
and GBPV_ShowType=#ShowType#
</isNotEmpty>
<isNotEmpty prepend=" " property="CombineType">
and GBPV_CombineType=#CombineType#
</isNotEmpty>
<isNotEmpty prepend=" " property="IsNeedExchange">
and GBPV_IsNeedExchange=#IsNeedExchange#
</isNotEmpty> and DelFlag='0' and GBPV_State='2' )
) f where row_num between (#Page#-1)*#Rows#+1 and (#Page#-1)*#Rows#+#Rows# </select> <!--查询店铺的商品详情列表-->
<select id="GetShopGoodsGbpvListForInclude" resultClass="Goods.SPI.ShopGoodsGbpvInfoVM" >
select
GDI_ID ID,GDI_GoodID GoodsID,GDI_ShopID ShopID,GDI_GBPVID GbpvID,GDI_Title Title,GDI_ImgURL ImgURL,GBPV_SKUGroupName SKUGroupName,
case when GDI_GetGoodsType='2' or GDI_GetGoodsType='3' then
isnull((select top 1 GIBT_Price from goodInfoTable with(nolock)
where GIBT_GbpvID=GDI_GBPVID and delflag='0'
and GIBT_EndDate>=getdate() and GIBT_Price>0 and ( GIBT_CityID=#CityID# or GIBT_CityID='*')
order by GIBT_StartDate asc
),0)
else
isnull((select top 1 GP_Price from pricetable c with(nolock) where GP_GBPVID = Gbpv_ID and GP_ShopID=Gbpv_ShopID and c.DelFlag='0'),0)
end Price
from goodDetailTable b with(nolock)
inner join goodPropertyTable j with(nolock) on GBPV_ID=GDI_GBPVID <isNotEmpty prepend=" " property="SaleType">
and GBPV_SaleType=#SaleType#
</isNotEmpty>
<isNotEmpty prepend=" " property="ShowType">
and GBPV_ShowType=#ShowType#
</isNotEmpty>
<isNotEmpty prepend=" " property="CombineType">
and GBPV_CombineType=#CombineType#
</isNotEmpty>
and GBPV_State='2' and j.DelFlag='0' where GDI_GoodID=#GoodsID# and GDI_ShopID=#ShopID# and b.DelFlag='0'
and (GDI_EndValidityDate>getdate() or GDI_EndValidityDate is null) order by GBPV_Sort
</select> <!--新增商品标签、城市、价格、库存、图片、介绍、售后、反选城市信息-->
<update id="CreateGoodsParams" parameterClass="Goods.SPI.CreateGoodsDto"> update goodTagTable set DelFlag='1',LastModifier=#LastModifier#,LastModifyTime=#LastModifyTime#
where GTS_GoodsID=#GoodsID# and GTS_GbpvID=#GbpvID# and GTS_ShopID=#ShopID#
<isNotEmpty prepend=" " property="ExistsTagList">
and GTS_ID not in
<iterate open="(" close=")" conjunction="," property="ExistsTagList" >
#ExistsTagList[].ID#
</iterate>
</isNotEmpty>
and DelFlag='0' <isNotEmpty prepend=" " property="ExistsTagList">
<iterate open=" " close=" " conjunction=";" property="ExistsTagList" >
update goodTagTable set
GTS_TagID=#ExistsTagList[].TagID#
,GTS_CityID=#ExistsTagList[].CityID#
,GTS_Sort=#ExistsTagList[].Sort#
,LastModifier=#LastModifier#
,LastModifyTime=#LastModifyTime#
where GTS_ID=#ExistsTagList[].ID#
and GTS_GbpvID=#ExistsTagList[].GbpvID# and GTS_ShopID=#ExistsTagList[].ShopID#
and DelFlag='0'
</iterate>
</isNotEmpty> <isNotEmpty prepend=" " property="NotExistsTagList">
<iterate open=" " close=" " conjunction=";" property="NotExistsTagList" >
insert into goodTagTable (GTS_ID,GTS_GoodsID,GTS_GbpvID,GTS_ShopID,GTS_CityID,GTS_TagID,GTS_Sort,DelFlag,Creator,CreateTime,LastModifier,LastModifyTime)
values(#NotExistsTagList[].ID#,#NotExistsTagList[].GoodsID#,#NotExistsTagList[].GbpvID#,#NotExistsTagList[].ShopID#,#NotExistsTagList[].CityID#,#NotExistsTagList[].TagID#,#NotExistsTagList[].Sort#,0,#Creator#,#CreateTime#,#LastModifier#,#LastModifyTime#) </iterate>
</isNotEmpty> <include refid="UpdateGoodsTimeInfo"></include>
</update> <!--更新商品销售日期信息-->
<sql id="UpdateGoodsTimeInfo">
update goodInfoTable set DelFlag='1',LastModifier=#LastModifier#,LastModifyTime=#LastModifyTime#
where GIBT_GoodsID=#GoodsID# and GIBT_GbpvID=#GbpvID# and GIBT_ShopID=#ShopID#
<isNotEmpty prepend=" " property="ExistsSaleDaysInfoList">
and GIBT_ID not in
<iterate open="(" close=")" conjunction="," property="ExistsSaleDaysInfoList" >
#ExistsSaleDaysInfoList[].ID#
</iterate>
</isNotEmpty>
and DelFlag='0'
<isNotEmpty prepend=" " property="ExistsSaleDaysInfoList">
<iterate open=" " close=" " conjunction=";" property="ExistsSaleDaysInfoList" >
update goodInfoTable set
GIBT_MarketPrice=#ExistsSaleDaysInfoList[].MarketPrice#
,GIBT_Price=#ExistsSaleDaysInfoList[].Price#
,GIBT_Inventory=#ExistsSaleDaysInfoList[].Inventory#
,GIBT_StartDate=#ExistsSaleDaysInfoList[].StartDate#
,GIBT_EndDate=#ExistsSaleDaysInfoList[].EndDate#
,GIBT_CityID=#ExistsSaleDaysInfoList[].CityID#
,LastModifier=#LastModifier#,LastModifyTime=#LastModifyTime#
where GIBT_ID=#ExistsSaleDaysInfoList[].ID#
and GIBT_GbpvID=#ExistsSaleDaysInfoList[].GbpvID# and GIBT_ShopID=#ExistsSaleDaysInfoList[].ShopID#
and DelFlag='0'
</iterate>
</isNotEmpty>
<isNotEmpty prepend=" " property="NotExistsSaleDaysInfoList">
<iterate open=" " close=" " conjunction=";" property="NotExistsSaleDaysInfoList" >
insert into goodInfoTable (GIBT_ID,GIBT_ShopID,GIBT_GoodsID,GIBT_GbpvID,GIBT_CityID,GIBT_Price,GIBT_MarketPrice,GIBT_Inventory,GIBT_StartDate,GIBT_EndDate,DelFlag,Creator,CreateTime,LastModifier,LastModifyTime)
values(#NotExistsSaleDaysInfoList[].ID#,#NotExistsSaleDaysInfoList[].ShopID#,#NotExistsSaleDaysInfoList[].GoodsID#,#NotExistsSaleDaysInfoList[].GbpvID#,#NotExistsSaleDaysInfoList[].CityID#,#NotExistsSaleDaysInfoList[].Price#,#NotExistsSaleDaysInfoList[].MarketPrice#,#NotExistsSaleDaysInfoList[].Inventory#,#NotExistsSaleDaysInfoList[].StartDate#,#NotExistsSaleDaysInfoList[].EndDate#,0,#Creator#,#CreateTime#,#LastModifier#,#LastModifyTime#)
</iterate>
</isNotEmpty>
</sql> </statements>
</sqlMap>
常用IBatis属性的更多相关文章
- 了解screen对象的常用视图属性
前面的话 screen对象基本上只用来表明客户端的能力,其中包括浏览器窗口外部的显示器的信息,如像素高度和宽度等.每个浏览器中的screen对象都包含着各不相同的属性.本文将详细介绍screen对象的 ...
- 【转】MySQL数据类型和常用字段属性总结
来源:http://www.jb51.net/article/55853.htm 这里先总结数据类型.MySQL中的数据类型大的方面来分,可以分为:日期和时间.数值,以及字符串.下面就分开来进行总结. ...
- MySQL数据类型和常用字段属性总结
前言 好比C++中,定义int类型需要多少字节,定义double类型需要多少字节一样,MySQL对表每个列中的数据也会实行严格控制,这是数据驱动应用程序成功的关键.MySQL提供了一组可以赋给表中各个 ...
- 12-27cell常用的属性
1.创建cell // 创建一个cell并且设置cell的风格 UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UI ...
- CSS属性(常用的属性)
CSS属性(常用的属性)http://www.w3school.com.cn/cssref/index.asp 一:文本与字体属性 1.字体属性 (1):font-size:字体的大小(例如:font ...
- javascript中常用坐标属性offset、scroll、client
原文:javascript中常用坐标属性offset.scroll.client 今天在学习js的时候觉得这个问题比较容易搞混,所以自己画了一个简单的图,并且用js控制台里面输出测试了下,便于理解. ...
- CSS样式表之常用文本属性
断更了两周了,因为纠结之后在学java啦,但是还是要把学过的前端知识更完 以下的一些文本属性是CSS最常用的属性: [长度单位]:px(像素) [颜色单位]: 十六进制:#ffffff 分别对应红绿蓝 ...
- css常用文本属性
[CSS常用文本属性] 1. 字体.字号类: ① font-weight: 字体粗细. bold-加粗.normal-正常.lighter-细体 也可以使用100-900数值,400表示normal, ...
- 常用css属性
一.常用css属性 (1) *block(区块) 行高 line-height:数值 | inherit | normal;字间距 letter-spacing: 数值 | inherit | nor ...
- CSS常用样式属性
1.CSS字体和文本相关属性 属性 font-family 规定文本的字体系列,比如:“serif” ''sans-serif" font-size 规定文本的字体尺寸 font-style ...
随机推荐
- flexible.js源码分析
(function flexible(window,document){ // 获取html的根元素 var docEl = document.documentElement; // dpr 物理像素 ...
- 完全机器模拟浏览器操作自动刷网课!不怕被封!!-----python基于selenium实现超星学习通刷视频网课
(使用过程中有小伙伴反映如果课程的第一章是空白的页面会报错,我当时做的时候是根据我自己的课程,没有第一节是空页面的现象,这个以后有时间我再改一下吧,或者小伙伴自己修改一下也可) 原谅我这个标题党,对叭 ...
- MySQL 修改字段子表中的顺序
修改字段排列位置 ALTER TABLE 表名 MODIFY 字段名1 数据类型 FIRST|AFTER 字段名2 参数说明 FIRST,可选参数 将字段1,修改为表的第一个字段. AFTER 字段名 ...
- FMC子卡设计资料原理图:FMC550-基于ADRV9002双窄带宽带射频收发器FMC子卡
FMC550-基于ADRV9002双窄带宽带射频收发器FMC子卡 一.产品概述 ADRV9002 是一款高性能.高线性度.高动态范围收发器,旨在针对性能与功耗系统进行优化.该设备是可配置的,非常适合要 ...
- 中间件Middleware 使用及相关概念
中间件是装配再应用管道里处理请求和相应的软件,是使用Use,Map,Run扩展方法配置的请求委托,请求委托可以是类,或者匿名方法.每个中间件可调用下一个中间件,直到终端中间件(不调用下一个中间件的就是 ...
- Oracle function函数中无法使用update更新
CREATE OR REPLACE FUNCTION changePY RETURN VARCHAR2 as PRAGMA AUTONOMOUS_TRANSACTION; --as 或者 is 后边 ...
- CryptoKit 实现 椭圆曲线ECC加密
1.有没有一种方式让两个人的对话绝对安全呢?答案是肯定有的 那就是使用 椭圆曲线ECC加密 2.椭圆曲线ECC加密原理 假设有两个用户A和B .A随机生成一个密码对包含了公钥和私钥 同理B也随机生成一 ...
- uniapp - 设置代理
uniapp - 设置代理 HbuilderX 找到 manifest.json 文件,点击源码视图 "h5" : { "title" : "案件要素 ...
- canvas 学习笔记
1.利用上下文对象进行绘制画笔 var canvas=canvas.getContext('2d') 2.绘制路径 canvas.rect(30,30,300,300) 3.填充 canvas.fil ...
- python_类 对象 属性
1, 类 (class) 类的概念表示某种对象的集合,用于表示某一种相同对象的模板.例如:人作为一个类 由这个"人"类定义出来的内容就是这个类定义出来的对象,类还拥有属性和功能,属 ...