中扬CRM客户关系管理系统
#
lsh
2024-04-15 13a34d2197b001799ef8f0f09e5b48af2add0926
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
<?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.zy.crm.manager.mapper.PlanUrlMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.PlanUrl">
        <id column="id" property="id" />
        <result column="plan_id" property="planId" />
        <result column="url" property="url" />
        <result column="name" property="name" />
        <result column="file_size" property="fileSize" />
        <result column="user_name" property="userName" />
        <result column="user_id" property="userId" />
        <result column="type" property="type" />
        <result column="hide_url" property="hideUrl" />
        <result column="status" property="status" />
 
    </resultMap>
 
    <select id="selectPlanUrlIdByPlanId" resultType="java.lang.Integer">
        select id from man_plan_url
        where 1=1
        and plan_id=#{planId}
        <if test="type != 0">
            and type=#{type}
        </if>
        <if test="hideUrl != 0">
            and hide_url=#{hideUrl}
        </if>
        <if test="status != 0">
            and status=#{status}
        </if>
        or (plan_id=#{planId} and hide_url=0 )
    </select>
 
    <select id="selectPlanUrlByPlanId" resultMap="BaseResultMap">
        select * from man_plan_url
        where 1=1
        and plan_id=#{planId}
        <if test="type != 0">
            and type=#{type}
        </if>
        <if test="hideUrl != 0">
            and hide_url=#{hideUrl}
        </if>
        <if test="status != 0">
            and status=#{status}
        </if>
        or (plan_id=#{planId} and hide_url=0 )
    </select>
 
</mapper>