张天森
2022-11-16 c6aeb75bd619ba0b22fd7e19e9aa62783b4a010f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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.panzhihua.service_community.dao.ConvenientElevatingPointDAO">
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ConvenientElevatingPointDO">
        <!--@Table com_convenient_elevating_point-->
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="community_id" jdbcType="VARCHAR" property="communityId"/>
        <result column="community_name" jdbcType="VARCHAR" property="communityName"/>
        <result column="address" jdbcType="VARCHAR" property="address"/>
        <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
        <result column="phone" jdbcType="VARCHAR" property="phone"/>
        <result column="wechat_account" jdbcType="VARCHAR" property="wechatAccount"/>
        <result column="lat" jdbcType="VARCHAR" property="lat"/>
        <result column="lon" jdbcType="VARCHAR" property="lon"/>
        <result column="business_status" property="businessStatus"/>
        <result column="cumulative_goods_num" jdbcType="BIGINT" property="cumulativeGoodsNum"/>
        <result column="prepare_goods_num" jdbcType="BIGINT" property="prepareGoodsNum"/>
        <result column="already_goods_num" jdbcType="BIGINT" property="alreadyGoodsNum"/>
        <result column="is_del" jdbcType="BIT" property="isDel"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="created_by" jdbcType="BIGINT" property="createdBy"/>
        <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
        <result column="updated_by" jdbcType="BIGINT" property="updatedBy"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, `name`, community_id, community_name, address, contacts, phone, wechat_account,
        lat, lon, `business_status`, cumulative_goods_num, prepare_goods_num, already_goods_num, is_del,
        created_at, created_by, updated_at, updated_by
    </sql>
 
    <select id="page" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientElevatingPointVO">
        SELECT cce.* FROM com_convenient_elevating_point cce WHERE cce.is_del = 0
        <if test="pageConvenientElevatingPointDTO.businessStatus != null and pageConvenientElevatingPointDTO.businessStatus != ''">
            AND cce.business_status = #{pageConvenientElevatingPointDTO.businessStatus}
        </if>
        <if test="pageConvenientElevatingPointDTO.communityId != null and pageConvenientElevatingPointDTO.communityId != 0">
            AND ccm.community_id = ${pageConvenientElevatingPointDTO.communityId}
        </if>
 
        <if test="pageConvenientElevatingPointDTO.keyword != null and pageConvenientElevatingPointDTO.keyword != &quot;&quot;">
            AND (
            cce.name LIKE CONCAT('%', #{pageConvenientElevatingPointDTO.keyword}, '%')
            OR cce.address LIKE CONCAT('%', #{pageConvenientElevatingPointDTO.keyword}, '%')
            OR cce.contacts LIKE CONCAT('%', #{pageConvenientElevatingPointDTO.keyword}, '%')
            )
        </if>
        ORDER BY cce.prepare_goods_num DESC
    </select>
 
    <update id="deletePointById">
        UPDATE com_convenient_elevating_point SET is_del = 1, updated_by = #{operator} WHERE id = #{pointId}
    </update>
</mapper>