|
|
|
@@ -7,6 +7,11 @@ |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> |
|
|
|
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> |
|
|
|
<result column="product_id" jdbcType="BIGINT" property="productId"/> |
|
|
|
<result column="product_title" jdbcType="VARCHAR" property="productTitle"/> |
|
|
|
<result column="product_pic" jdbcType="VARCHAR" property="productPic"/> |
|
|
|
<result column="product_sale_price" jdbcType="INTEGER" property="productSalePrice"/> |
|
|
|
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> |
|
|
|
|
|
|
|
<result column="type" jdbcType="TINYINT" property="type"/> |
|
|
|
<result column="way" jdbcType="TINYINT" property="way"/> |
|
|
|
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> |
|
|
|
@@ -18,8 +23,6 @@ |
|
|
|
|
|
|
|
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/> |
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone"/> |
|
|
|
<result column="product_title" jdbcType="VARCHAR" property="productTitle"/> |
|
|
|
<result column="product_pic" jdbcType="VARCHAR" property="productPic"/> |
|
|
|
<result column="author" jdbcType="VARCHAR" property="author"/> |
|
|
|
<result column="author_pic" jdbcType="VARCHAR" property="authorPic"/> |
|
|
|
</resultMap> |
|
|
|
@@ -28,7 +31,7 @@ |
|
|
|
o.`id`,o.`tenant_id`,o.`parent_tenant_id`,o.`c_user_id`,o.`product_id`,o.`type`,o.`way`,o.`payment_type`,o.`payment`, |
|
|
|
o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`, |
|
|
|
u.`nick_name`,u.`phone`, |
|
|
|
c.`title` product_title,c.`cover_img` product_pic, |
|
|
|
o.`product_title`,o.`product_pic`,o.`product_sale_price`, |
|
|
|
m.`name` author,m.`img_url` author_pic |
|
|
|
</sql> |
|
|
|
|
|
|
|
@@ -86,11 +89,11 @@ |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != productTitle "> |
|
|
|
and c.`title` like concat('%', #{productTitle},'%') |
|
|
|
and o.`title` like concat('%', #{productTitle},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != authorId "> |
|
|
|
and c.merchant_id = #{authorId} |
|
|
|
and o.merchant_id = #{authorId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != author "> |
|
|
|
@@ -118,11 +121,94 @@ |
|
|
|
<include refid="allColumns"/> |
|
|
|
from tt_order o |
|
|
|
left join tt_c_user u on o.c_user_id = u.id |
|
|
|
left join tt_coupon c on o.product_id = c.id |
|
|
|
left join wx_merchant m on c.merchant_id = m.id |
|
|
|
left join wx_merchant m on o.merchant_id = m.id |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCList" parameterType="com.iformall.domain.po.tt.TtOrder" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumnsC"/> |
|
|
|
from tt_order o |
|
|
|
left join wx_merchant m on o.merchant_id = m.id |
|
|
|
<include refid="dynamicWhereConditionsC"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<sql id="allColumnsC"> |
|
|
|
o.`id`,o.`tenant_id`,o.`parent_tenant_id`,o.`c_user_id`,o.`product_id`,o.`type`,o.`way`,o.`payment_type`,o.`payment`, |
|
|
|
o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`, |
|
|
|
o.`product_title`,o.`product_pic`,o.`product_sale_price`, |
|
|
|
m.`name` author,m.`img_url` author_pic |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditionsC"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and o.`id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != cUserId "> |
|
|
|
and o.`c_user_id` = #{cUserId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != productId "> |
|
|
|
and o.`product_id` = #{productId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != type "> |
|
|
|
and o.`type` = #{type} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != way "> |
|
|
|
and o.`way` = #{way} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != paymentType "> |
|
|
|
and o.`payment_type` = #{paymentType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test="startdate != null"> |
|
|
|
and o.`payment_time` >= #{startdate} |
|
|
|
</if> |
|
|
|
<if test="enddate != null"> |
|
|
|
and o.`payment_time` <= #{enddate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != orderStatus "> |
|
|
|
and o.`order_status` = #{orderStatus} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != authorId "> |
|
|
|
and o.merchant_id = #{authorId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != author "> |
|
|
|
and m.`name` like concat('%', #{author},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != statusS "> |
|
|
|
and o.`order_status` in |
|
|
|
<foreach collection="statusS" index="index" item="sItem" open="(" separator="," close=")"> |
|
|
|
#{sItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and o.`id` in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
order by o.`update_date` desc |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findListCount" parameterType="com.iformall.domain.po.tt.TtOrder" resultType="Integer"> |
|
|
|
select count(1) |
|
|
|
from tt_order |
|
|
|
|