You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
3.0 KiB
81 lines
3.0 KiB
<?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.epmet.dao.CustomerDao">
|
|
|
|
<resultMap type="com.epmet.entity.CustomerEntity" id="customerMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="customerName" column="CUSTOMER_NAME"/>
|
|
<result property="title" column="TITLE"/>
|
|
<result property="organizationNumber" column="ORGANIZATION_NUMBER"/>
|
|
<result property="organizationImg" column="ORGANIZATION_IMG"/>
|
|
<result property="validityTime" column="VALIDITY_TIME"/>
|
|
<result property="customerAdmin" column="CUSTOMER_ADMIN"/>
|
|
<result property="customerPassword" column="CUSTOMER_PASSWORD"/>
|
|
<result property="organizationLevel" column="ORGANIZATION_LEVEL"/>
|
|
<result property="logo" column="LOGO"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<!-- 运营端-获取有效客户列表 (未删除+有效期内的,按照客户名称排序 )-->
|
|
<select id="selectListValidCustomerResultDTO" resultType="com.epmet.dto.result.ValidCustomerResultDTO">
|
|
SELECT c.id AS CUSTOMER_ID,
|
|
c.CUSTOMER_NAME,
|
|
CASE WHEN c.LOGO IS NULL THEN '' ELSE c.LOGO END AS LOGO
|
|
FROM
|
|
customer c
|
|
WHERE
|
|
c.DEL_FLAG = '0'
|
|
AND c.VALIDITY_TIME > NOW()
|
|
ORDER BY
|
|
CONVERT ( c.CUSTOMER_NAME USING gbk ) ASC
|
|
</select>
|
|
|
|
<!-- 根据客户id查询客户信息 -->
|
|
<select id="selectListByIds" parameterType="map" resultType="com.epmet.dto.CustomerDTO">
|
|
SELECT
|
|
*
|
|
FROM
|
|
customer c
|
|
WHERE
|
|
c.DEL_FLAG = '0'
|
|
AND c.id IN
|
|
<foreach item="customerId" collection="customerIdList" open="(" separator="," close=")">
|
|
#{customerId}
|
|
</foreach>
|
|
</select>
|
|
|
|
<!--根据名字查询客户-->
|
|
<select id="selectByCustomerName" resultType="com.epmet.dto.CustomerDTO">
|
|
SELECT *
|
|
FROM customer
|
|
WHERE CUSTOMER_NAME = #{customerName}
|
|
</select>
|
|
|
|
<select id="selectCustomerList" resultType="com.epmet.dto.result.CustomerResultDTO">
|
|
SELECT
|
|
id AS "customerId",
|
|
customer_name AS "customerName",
|
|
IFNULL(logo,"") AS "logo"
|
|
FROM
|
|
customer
|
|
WHERE
|
|
del_flag = '0'
|
|
<if test='customerName != "" and customerName != null'>
|
|
AND customer_name LIKE concat('%', trim(#{customerName}), '%')
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getAllList" resultMap="customerMap">
|
|
SELECT
|
|
*
|
|
FROM customer
|
|
WHERE
|
|
del_flag = '0'
|
|
</select>
|
|
</mapper>
|
|
|