65 lines
2.1 KiB
XML
65 lines
2.1 KiB
XML
<?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.jwl.driver.server.mapper.TdMemberMapper">
|
|
|
|
<select id="queryMember" resultType="com.jwl.driver.server.vo.MemberVo">
|
|
select
|
|
tm.MEMBER_ID,
|
|
tm.MEMBER_NAME,
|
|
tm.CAR_TYPE_ID,
|
|
tm.PRICE,
|
|
tm.DISCOUNT,
|
|
tm.DURATION,
|
|
tm.SUBJECTS,
|
|
tm.UNIT,
|
|
tm.DESC,
|
|
tm.IS_ACTIVE
|
|
from
|
|
td_member tm
|
|
<where>
|
|
tm.IS_ACTIVE = '0'
|
|
<if test="queryDto.memberId !=null">
|
|
and tm.MEMBER_ID = #{queryDto.memberId}
|
|
</if>
|
|
<if test="queryDto.carTypeId !=null">
|
|
and tm.CAR_TYPE_ID = #{queryDto.carTypeId}
|
|
</if>
|
|
<if test="queryDto.subject !=null and queryDto.subject !=''">
|
|
and find_in_set(#{queryDto.subject},tm.SUBJECTS)
|
|
</if>
|
|
</where>
|
|
order by tm.SHOW_ORDER
|
|
</select>
|
|
<select id="queryUserMember" resultType="com.jwl.driver.server.vo.MemberVo">
|
|
select
|
|
tsum.USER_ID,
|
|
tsum.END_DATE,
|
|
tm.MEMBER_ID,
|
|
tm.MEMBER_NAME,
|
|
tm.CAR_TYPE_ID,
|
|
tm.PRICE,
|
|
tm.DISCOUNT,
|
|
tm.DURATION,
|
|
tm.SUBJECTS,
|
|
tm.UNIT,
|
|
tm.DESC,
|
|
tm.IS_ACTIVE
|
|
from
|
|
td_sys_user_member tsum
|
|
left join td_member tm on tsum.MEMBER_ID = tm.MEMBER_ID
|
|
<where>
|
|
tsum.USER_ID = #{userId} and sysdate() between tsum.START_DATE and tsum.END_DATE
|
|
<if test="queryDto.memberId !=null">
|
|
and tsum.MEMBER_ID = #{queryDto.memberId}
|
|
</if>
|
|
<if test="queryDto.carTypeId !=null">
|
|
and tm.CAR_TYPE_ID = #{queryDto.carTypeId}
|
|
</if>
|
|
<if test="queryDto.subject !=null and queryDto.subject !=''">
|
|
and find_in_set(#{queryDto.subject},tm.SUBJECTS)
|
|
</if>
|
|
</where>
|
|
order by tm.SHOW_ORDER
|
|
</select>
|
|
</mapper>
|