Sumuxi9797926 commented on issue #29788:
URL:
https://github.com/apache/shardingsphere/issues/29788#issuecomment-1901903973
<select id="queryMallOrderInfoByPage"
parameterType="com.frxs.fh.shopping.logistics.vo.req.MallOrderReq"
resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
order_info main
<where>
<if test="mallOrderReq.skuOrProductName != null and
mallOrderReq.skuOrProductName != ''">
EXISTS ( SELECT 1 FROM order_item sub WHERE sub.order_no =
main.order_no AND ( sub.sku_code LIKE concat('%',
#{mallOrderReq.skuOrProductName}, '%') OR sub.product_name LIKE concat('%',
#{mallOrderReq.skuOrProductName}, '%') ) ) AND
</if>
main.del_flag = 0 AND main.wid = #{mallOrderReq.wid}
<if test="mallOrderReq.orderNo != null and mallOrderReq.orderNo
!= ''">
AND main.order_no = #{mallOrderReq.orderNo}
</if>
<if test="mallOrderReq.receiveAddr != null and
mallOrderReq.receiveAddr != ''">
AND main.receive_addr LIKE concat('%',
#{mallOrderReq.receiveAddr}, '%')
</if>
<if test="mallOrderReq.orderStatus != null and
mallOrderReq.orderStatus != ''">
AND main.order_status = #{mallOrderReq.orderStatus}
</if>
<if test="mallOrderReq.orderStatusList != null and
mallOrderReq.orderStatusList.size() > 0">
AND main.order_status IN
<foreach collection="mallOrderReq.orderStatusList"
separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
<if test="mallOrderReq.userNameOrMobile != null and
mallOrderReq.userNameOrMobile != ''">
AND ( main.receive_name LIKE concat('%',
#{mallOrderReq.userNameOrMobile}, '%') OR main.receive_phone LIKE concat('%',
#{mallOrderReq.userNameOrMobile}, '%') )
</if>
<choose>
<when test="mallOrderReq.startTime != null and
mallOrderReq.startTime != '' and mallOrderReq.endTime != null and
mallOrderReq.endTime != ''">
AND main.create_date BETWEEN #{mallOrderReq.startTime}
AND #{mallOrderReq.endTime}
</when>
<otherwise>
<if test="mallOrderReq.startTime != null and
mallOrderReq.startTime != ''">
AND main.create_date > #{mallOrderReq.startTime}
</if>
<if test="mallOrderReq.endTime != null and
mallOrderReq.endTime != ''">
AND main.create_date < #{mallOrderReq.endTime}
</if>
</otherwise>
</choose>
</where>
ORDER BY main.create_date DESC
</select>这是xml标签
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]