|
@@ -0,0 +1,108 @@
|
|
|
+<?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.yh.saas.plugin.yiliangyiyun.mapper.GeneralAuditInfoMapper">
|
|
|
+
|
|
|
+ <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ COUNT(id)
|
|
|
+ FROM general_audit_info
|
|
|
+ WHERE delete_flag = '0'
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(sponsor) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(audit_business_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
+ <if test="searchType == 1">
|
|
|
+ AND approve_status is not null
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 2">
|
|
|
+ AND status='已驳回' and approve_status not null
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND status='已通过' and approve_status not null
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="businessType != null and businessType != ''">
|
|
|
+ AND business_type = #{businessType}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ AND (DATE_FORMAT(create_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ AND (DATE_FORMAT(create_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="businessKeys != null and businessKeys.size > 0">
|
|
|
+ and(
|
|
|
+ <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
|
|
|
+ id = #{businessValue}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="getListByCondition" parameterType="Map" resultType="com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ sale_plan_no as salePlanNo,
|
|
|
+ sale_plan_type as salePlanType,
|
|
|
+ comp_id as compId,
|
|
|
+ title,
|
|
|
+ goods_name as goodsName,
|
|
|
+ weight,
|
|
|
+ basis_price as basisPrice,
|
|
|
+ unit_price as unitPrice,
|
|
|
+ send_private as sendPrivate,
|
|
|
+ sale_price as salePrice,
|
|
|
+ planned_sale_volume as plannedSaleVolume,
|
|
|
+ send_city as sendCity,
|
|
|
+ send_area as sendArea,
|
|
|
+ send_warehouse as sendWarehouse,
|
|
|
+ status,
|
|
|
+ status_flag as statusFlag,
|
|
|
+ seller,
|
|
|
+ seller_phone as sellerPhone,
|
|
|
+ pc_flag as pcFlag,
|
|
|
+ show_flag as showFlag,
|
|
|
+ update_date as updateDate
|
|
|
+ FROM general_audit_info
|
|
|
+ WHERE delete_flag = '0'
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(sponsor) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(audit_business_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
+ <if test="searchType == 1">
|
|
|
+ AND approve_status is not null
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 2">
|
|
|
+ AND status='已驳回' and approve_status not null
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND status='已通过' and approve_status not null
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="businessType != null and businessType != ''">
|
|
|
+ AND business_type = #{businessType}
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ AND (DATE_FORMAT(create_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ AND (DATE_FORMAT(create_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="businessKeys != null and businessKeys.size > 0">
|
|
|
+ and(
|
|
|
+ <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
|
|
|
+ id = #{businessValue}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ ORDER BY create_date DESC
|
|
|
+ <if test="currentPage != null and currentPage != ''">
|
|
|
+ LIMIT ${startRecord}, ${pageSize}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|