94 lines
3.6 KiB
XML
94 lines
3.6 KiB
XML
<?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="com.gxwebsoft.common.system.mapper.MerchantMapper">
|
|
|
|
<!-- 关联查询sql -->
|
|
<sql id="selectSql">
|
|
SELECT a.*
|
|
FROM sys_merchant a
|
|
<where>
|
|
<if test="param.merchantId != null">
|
|
AND a.merchant_id = #{param.merchantId}
|
|
</if>
|
|
<if test="param.merchantName != null">
|
|
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
|
</if>
|
|
<if test="param.merchantCode != null">
|
|
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
|
</if>
|
|
<if test="param.image != null">
|
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
|
</if>
|
|
<if test="param.phone != null">
|
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
|
</if>
|
|
<if test="param.realName != null">
|
|
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
|
</if>
|
|
<if test="param.shopType != null">
|
|
AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%')
|
|
</if>
|
|
<if test="param.category != null">
|
|
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
|
</if>
|
|
<if test="param.commission != null">
|
|
AND a.commission = #{param.commission}
|
|
</if>
|
|
<if test="param.keywords != null">
|
|
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
|
</if>
|
|
<if test="param.files != null">
|
|
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
|
</if>
|
|
<if test="param.ownStore != null">
|
|
AND a.own_store = #{param.ownStore}
|
|
</if>
|
|
<if test="param.recommend != null">
|
|
AND a.recommend = #{param.recommend}
|
|
</if>
|
|
<if test="param.goodsReview != null">
|
|
AND a.goods_review = #{param.goodsReview}
|
|
</if>
|
|
<if test="param.comments != null">
|
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
|
</if>
|
|
<if test="param.status != null">
|
|
AND a.status = #{param.status}
|
|
</if>
|
|
<if test="param.sortNumber != null">
|
|
AND a.sort_number = #{param.sortNumber}
|
|
</if>
|
|
<if test="param.createTimeStart != null">
|
|
AND a.create_time >= #{param.createTimeStart}
|
|
</if>
|
|
<if test="param.createTimeEnd != null">
|
|
AND a.create_time <= #{param.createTimeEnd}
|
|
</if>
|
|
<if test="param.deleted != null">
|
|
AND a.deleted = #{param.deleted}
|
|
</if>
|
|
<if test="param.deleted == null">
|
|
AND a.deleted = 0
|
|
</if>
|
|
<if test="param.keywords != null">
|
|
AND (
|
|
a.merchant_name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
|
OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
)
|
|
</if>
|
|
</where>
|
|
</sql>
|
|
|
|
<!-- 分页查询 -->
|
|
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.Merchant">
|
|
<include refid="selectSql"></include>
|
|
</select>
|
|
|
|
<!-- 查询全部 -->
|
|
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.Merchant">
|
|
<include refid="selectSql"></include>
|
|
</select>
|
|
|
|
</mapper>
|