<?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>
|