|
@@ -2,4 +2,90 @@
|
|
|
<!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.SettledCompanyInfoMapper">
|
|
|
|
|
|
+
|
|
|
+ <!-- 获得总数 -->
|
|
|
+ <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ COUNT(id)
|
|
|
+ FROM settled_company_info
|
|
|
+ WHERE delete_flag = '0'
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(comp_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(create_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
+ <if test="searchType == 1">
|
|
|
+ AND status_flag = '1'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 2">
|
|
|
+ AND status_flag = '3'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND status_flag = '5'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="createPhone != null and createPhone != ''">
|
|
|
+ AND create_phone = #{createPhone}
|
|
|
+ </if>
|
|
|
+ <if test="showFlag != null and showFlag != ''">
|
|
|
+ AND show_flag = #{showFlag}
|
|
|
+ </if>
|
|
|
+ <if test="mainBusinessType != null and mainBusinessType != ''">
|
|
|
+ AND main_business_type = #{mainBusinessType}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 获得销售计划列表 -->
|
|
|
+ <select id="getListByCondition" parameterType="Map"
|
|
|
+ resultType="com.yh.saas.plugin.yiliangyiyun.entity.SettledCompanyInfo">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ comp_name as compName,
|
|
|
+ create_phone as createPhone,
|
|
|
+ main_business_type as mainBusinessType,
|
|
|
+ title,
|
|
|
+ company_profile as companyProfile,
|
|
|
+ longitude,
|
|
|
+ latitude,
|
|
|
+ province,
|
|
|
+ city,
|
|
|
+ area,
|
|
|
+ detailed_address as detailedAddress,
|
|
|
+ attachment_address as attachmentAddress,
|
|
|
+ status,
|
|
|
+ status_flag as statusFlag,
|
|
|
+ show_flag as showFlag,
|
|
|
+ update_date as updateDate
|
|
|
+ FROM settled_company_info
|
|
|
+ WHERE delete_flag = '0'
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(comp_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(create_phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="searchType != null and searchType != ''">
|
|
|
+ <if test="searchType == 1">
|
|
|
+ AND status_flag = '1'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 2">
|
|
|
+ AND status_flag = '3'
|
|
|
+ </if>
|
|
|
+ <if test="searchType == 3">
|
|
|
+ AND status_flag = '5'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="createPhone != null and createPhone != ''">
|
|
|
+ AND create_phone = #{createPhone}
|
|
|
+ </if>
|
|
|
+ <if test="showFlag != null and showFlag != ''">
|
|
|
+ AND show_flag = #{showFlag}
|
|
|
+ </if>
|
|
|
+ <if test="mainBusinessType != null and mainBusinessType != ''">
|
|
|
+ AND main_business_type = #{mainBusinessType}
|
|
|
+ </if>
|
|
|
+ ORDER BY status_flag asc , update_date DESC
|
|
|
+ <if test="currentPage != null and currentPage != ''">
|
|
|
+ LIMIT ${startRecord}, ${pageSize}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|