Commit 2dbe8014 authored by 赵啸非's avatar 赵啸非

设备列表导出优化

parent 2e726eae
......@@ -9,6 +9,7 @@
<id property="platformId" column="platformId" />
<result property="productName" column="productName" />
<result property="productCode" column="productCode" />
<result property="homeUrl" column="homeUrl" />
<result property="productRemark" column="productRemark" />
<result property="createUserId" column="createUserId" />
<result property="createTime" column="createTime" />
......@@ -33,6 +34,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productCode') or colPickMode == 1 and data.containsKey('productCode')))">
a.productCode,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('homeUrl') or colPickMode == 1 and data.containsKey('homeUrl')))">
a.homeUrl,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productRemark') or colPickMode == 1 and data.containsKey('productRemark')))">
a.productRemark,
</if>
......@@ -53,18 +57,18 @@
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="ProductEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_product
(platformId,productName,productCode,productRemark,createUserId,createTime,updateUserId,updateTime)
(platformId,productName,productCode,homeUrl,productRemark,createUserId,createTime,updateUserId,updateTime)
VALUES
(#{platformId},#{productName},#{productCode},#{productRemark},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
(#{platformId},#{productName},#{productCode},#{homeUrl},#{productRemark},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_product
(platformId,productName,productCode,productRemark,createUserId,createTime,updateUserId,updateTime)
(platformId,productName,productCode,homeUrl,productRemark,createUserId,createTime,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.platformId},#{item.productName},#{item.productCode},#{item.productRemark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
(#{item.platformId},#{item.productName},#{item.productCode},#{item.homeUrl},#{item.productRemark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
......@@ -86,6 +90,9 @@
<if test="(colPickMode==0 and data.containsKey('productCode')) or (colPickMode==1 and !data.containsKey('productCode'))">
a.productCode=#{data.productCode},
</if>
<if test="(colPickMode==0 and data.containsKey('homeUrl')) or (colPickMode==1 and !data.containsKey('homeUrl'))">
a.homeUrl=#{data.homeUrl},
</if>
<if test="(colPickMode==0 and data.containsKey('productRemark')) or (colPickMode==1 and !data.containsKey('productRemark'))">
a.productRemark=#{data.productRemark},
</if>
......@@ -145,6 +152,13 @@
</if>
</foreach>
</trim>
<trim prefix="homeUrl=(case" suffix="ELSE homeUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('homeUrl')) or (colPickMode==1 and !item.containsKey('homeUrl'))">
when a.id=#{item.id} then #{item.homeUrl}
</if>
</foreach>
</trim>
<trim prefix="productRemark=(case" suffix="ELSE productRemark end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('productRemark')) or (colPickMode==1 and !item.containsKey('productRemark'))">
......@@ -364,6 +378,21 @@
</foreach>
</if>
<if test="conditionParamRef.containsKey('homeUrl')">
<if test="conditionParamRef.homeUrl != null and conditionParamRef.homeUrl != ''">
${_conditionType_} a.homeUrl like #{${_conditionParam_}.homeUrl}
</if>
<if test="conditionParamRef.homeUrl == null">
${_conditionType_} a.homeUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('homeUrlList')">
${_conditionType_} a.homeUrl in
<foreach collection="conditionParamRef.homeUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('productRemark')">
<if test="conditionParamRef.productRemark != null and conditionParamRef.productRemark != ''">
${_conditionType_} a.productRemark like #{${_conditionParam_}.productRemark}
......@@ -483,6 +512,11 @@
<if test='orderCol.productCode != null and "DESC".equalsIgnoreCase(orderCol.productCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('homeUrl')">
a.homeUrl
<if test='orderCol.homeUrl != null and "DESC".equalsIgnoreCase(orderCol.homeUrl)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('productRemark')">
a.productRemark
<if test='orderCol.productRemark != null and "DESC".equalsIgnoreCase(orderCol.productRemark)'>DESC</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment