<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="order-marketingAudit" >
<select id="getMarketingAuditList" resultType="order-marketingAuditDTO" parameterType="hashmap" >
SELECT
ID,CREATE_BY,CREATE_TIME,UPDATE_BY,UPDATE_TIME,COUPON_ID,UID,QRCODE,ORDER_ID,ORDER_CODE,ORDER_LINE_ID,COMMISSION_TYPE,COMMISSION_RATE,STATUS,AUDIT_AMOUNT,IS_DEL FROM marketing_audit WHERE 1=1
<if test="createTime_begin != null and createTime_begin != ''">
AND CREATE_TIME <![CDATA[ >= ]]> #{
createTime_begin}
</if>
<if test="createTime_end != null and createTime_end != ''">
AND CREATE_TIME <![CDATA[ <= ]]> #{
createTime_end}
</if>
<if test="updateTime_begin != null and updateTime_begin != ''">
AND UPDATE_TIME <![CDATA[ >= ]]> #{
updateTime_begin}
</if>
<if test="updateTimee_end != null and updateTimee_end != ''">
AND UPDATE_TIME <![CDATA[ <= ]]> #{
updateTime_end}
</if>
<if test="id != null and id != ''">
AND ID=#{
id}
</if>
<if test="createBy != null and createBy != ''">
AND CREATE_BY=#{
createBy}
</if>
<if test="createTime != null and createTime != ''">
AND CREATE_TIME=#{
createTime}
</if>
<if test="updateBy != null and updateBy != ''">
AND UPDATE_BY=#{
updateBy}
</if>
<if test="updateTime != null and updateTime != ''">
AND UPDATE_TIME=#{
updateTime}
</if>
<if test="couponId != null and couponId != ''">
AND COUPON_ID=#{
couponId}
</if>
<if test="uid != null and uid != ''">
AND UID=#{
uid}
</if>
<if test="qrcode != null and qrcode != ''">
AND QRCODE=#{
qrcode}
</if>
<if test="orderId != null and orderId != ''">
AND ORDER_ID=#{
orderId}
</if>
<if test="orderCode != null and orderCode != ''">
AND ORDER_CODE=#{
orderCode}
</if>
<if test="orderLineId != null and orderLineId != ''">
AND ORDER_LINE_ID=#{
orderLineId}
</if>
<if test="commissionType != null and commissionType != ''">
AND COMMISSION_TYPE=#{
commissionType}
</if>
<if test="commissionRate != null and commissionRate != ''">
AND COMMISSION_RATE=#{
commissionRate}
</if>
<if test="status != null and status != ''">
AND STATUS=#{
status}
</if>
<if test="auditAmount != null and auditAmount != ''">
AND AUDIT_AMOUNT=#{
auditAmount}
</if>
<if test="isDel != null and isDel != ''">
AND IS_DEL=#{
isDel}
</if>
<choose>
<when test="createTimeSort == 1">
ORDER BY CREATE_TIME ASC
</when>
<when test="createTimeSort == 2">
ORDER BY CREATE_TIME DESC
</when>
<when test="updateTimeSort == 1">
ORDER BY UPDATE_TIME ASC
</when>
<when test="updateTimeSort == 2">
ORDER BY UPDATE_TIME DESC
</when>
<otherwise>
ORDER BY ID DESC
</otherwise>
</choose>
<if test="pageNo != null and pageNo >= 0 and pageSize != null and pageSize >= 0">
LIMIT #{
pageNo}, #{
pageSize}
</if>
</select>
<select id="getMarketingAuditCount" parameterType="hashmap" resultType="long">
SELECT COUNT(1) FROM marketing_audit WHERE 1=1
<if test="createTime_begin != null and createTime_begin != ''">
AND CREATE_TIME <![CDATA[ >= ]]> #{
createTime_begin}
</if>
<if test="createTime_end != null and createTime_end != ''">
AND CREATE_TIME <![CDATA[ <= ]]> #{
createTime_end}
</if>
<if test="id != null and id != ''">
AND ID=#{
id}
</if>
<if test="createBy != null and createBy != ''">
AND CREATE_BY=#{
createBy}
</if>
<if test="createTime != null and createTime != ''">
AND CREATE_TIME=#{
createTime}
</if>
<if test="updateBy != null and updateBy != ''">
AND UPDATE_BY=#{
updateBy}
</if>
<if test="updateTime != null and updateTime != ''">
AND UPDATE_TIME=#{
updateTime}
</if>
<if test="couponId != null and couponId != ''">
AND COUPON_ID=#{
couponId}
</if>
<if test="uid != null and uid != ''">
AND UID=#{
uid}
</if>
<if test="qrcode != null and qrcode != ''">
AND QRCODE=#{
qrcode}
</if>
<if test="orderId != null and orderId != ''">
AND ORDER_ID=#{
orderId}
</if>
<if test="orderCode != null and orderCode != ''">
AND ORDER_CODE=#{
orderCode}
</if>
<if test="orderLineId != null and orderLineId != ''">
AND ORDER_LINE_ID=#{
orderLineId}
</if>
<if test="commissionType != null and commissionType != ''">
AND COMMISSION_TYPE=#{
commissionType}
</if>
<if test="commissionRate != null and commissionRate != ''">
AND COMMISSION_RATE=#{
commissionRate}
</if>
<if test="status != null and status != ''">
AND STATUS=#{
status}
</if>
<if test="auditAmount != null and auditAmount != ''">
AND AUDIT_AMOUNT=#{
auditAmount}
</if>
<if test="isDel != null and isDel != ''">
AND IS_DEL=#{
isDel}
</if
mybatis常用的crud语法结构
最新推荐文章于 2022-11-06 14:59:12 发布