443 lines
16 KiB
XML
443 lines
16 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="cn.com.tenlion.systemcard.dao.cardcharge.ICardChargeDao">
|
|||
|
|
|||
|
<resultMap id="cardChargeDTO" type="cn.com.tenlion.systemcard.pojo.dtos.cardcharge.CardChargeDTO">
|
|||
|
<result column="card_charge_id" property="cardChargeId"/>
|
|||
|
<result column="card_charge_price" property="cardChargePrice"/>
|
|||
|
<result column="card_charge_end" property="cardChargeEnd"/>
|
|||
|
<result column="card_charge_mode" property="cardChargeMode"/>
|
|||
|
<result column="card_charge_company_id" property="cardChargeCompanyId"/>
|
|||
|
<result column="card_charge_company_number" property="cardChargeCompanyNumber"/>
|
|||
|
<result column="card_charge_status" property="cardChargeStatus"/>
|
|||
|
<result column="card_charge_remark" property="cardChargeRemark"/>
|
|||
|
<result column="card_charge_user_id" property="cardChargeUserId"/>
|
|||
|
<result column="card_charge_invitation_user_id" property="cardChargeInvitationUserId"/>
|
|||
|
<result column="user_username" property="cardChargeUserUsername"/>
|
|||
|
<result column="card_charge_order_number" property="cardChargeOrderNumber"/>
|
|||
|
<result column="card_charge_order_status" property="cardChargeOrderStatus"/>
|
|||
|
<result column="card_charge_order_time" property="cardChargeOrderTime"/>
|
|||
|
<result column="card_template_id" property="cardTemplateId"/>
|
|||
|
<result column="creator" property="creator"/>
|
|||
|
<result column="gmt_create" property="gmtCreate"/>
|
|||
|
<result column="modifier" property="modifier"/>
|
|||
|
<result column="gmt_modified" property="gmtModified"/>
|
|||
|
<result column="is_delete" property="isDelete"/>
|
|||
|
</resultMap>
|
|||
|
|
|||
|
<resultMap id="cardChargeBO" type="cn.com.tenlion.systemcard.pojo.bos.cardcharge.CardChargeBO">
|
|||
|
<result column="card_charge_id" property="cardChargeId"/>
|
|||
|
<result column="card_charge_price" property="cardChargePrice"/>
|
|||
|
<result column="card_charge_end" property="cardChargeEnd"/>
|
|||
|
<result column="card_charge_mode" property="cardChargeMode"/>
|
|||
|
<result column="card_charge_company_id" property="cardChargeCompanyId"/>
|
|||
|
<result column="card_charge_company_number" property="cardChargeCompanyNumber"/>
|
|||
|
<result column="card_charge_status" property="cardChargeStatus"/>
|
|||
|
<result column="card_charge_remark" property="cardChargeRemark"/>
|
|||
|
<result column="creator" property="creator"/>
|
|||
|
<result column="gmt_create" property="gmtCreate"/>
|
|||
|
<result column="modifier" property="modifier"/>
|
|||
|
<result column="gmt_modified" property="gmtModified"/>
|
|||
|
<result column="is_delete" property="isDelete"/>
|
|||
|
</resultMap>
|
|||
|
|
|||
|
<resultMap id="cardChargePO" type="cn.com.tenlion.systemcard.pojo.pos.cardcharge.CardChargePO">
|
|||
|
<result column="card_charge_id" property="cardChargeId"/>
|
|||
|
<result column="card_charge_price" property="cardChargePrice"/>
|
|||
|
<result column="card_charge_end" property="cardChargeEnd"/>
|
|||
|
<result column="card_charge_mode" property="cardChargeMode"/>
|
|||
|
<result column="card_charge_company_id" property="cardChargeCompanyId"/>
|
|||
|
<result column="card_charge_company_number" property="cardChargeCompanyNumber"/>
|
|||
|
<result column="card_charge_status" property="cardChargeStatus"/>
|
|||
|
<result column="card_charge_remark" property="cardChargeRemark"/>
|
|||
|
<result column="creator" property="creator"/>
|
|||
|
<result column="gmt_create" property="gmtCreate"/>
|
|||
|
<result column="modifier" property="modifier"/>
|
|||
|
<result column="gmt_modified" property="gmtModified"/>
|
|||
|
<result column="is_delete" property="isDelete"/>
|
|||
|
</resultMap>
|
|||
|
|
|||
|
<!-- 判断我的名片使用权限是否到期-->
|
|||
|
<select id="getLastEngTime" parameterType="java.lang.String" resultMap="cardChargeDTO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t1.card_charge_invitation_user_id,
|
|||
|
t1.card_charge_order_number,
|
|||
|
t1.card_template_id
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0 AND t1.card_charge_user_id = #{cardChargeUserId} AND t1.card_charge_order_status = '1'
|
|||
|
AND DATE_FORMAT( t1.card_charge_end , '%Y-%m-%d %H:%i:%s') > DATE_FORMAT( NOW() , '%Y-%m-%d %H:%i:%s' )
|
|||
|
ORDER BY
|
|||
|
t1.card_charge_end DESC
|
|||
|
LIMIT 1
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- 新增CBC名片收费记录表 -->
|
|||
|
<insert id="save" parameterType="map">
|
|||
|
INSERT INTO e_card_charge(
|
|||
|
card_charge_id,
|
|||
|
card_charge_price,
|
|||
|
card_charge_end,
|
|||
|
card_charge_mode,
|
|||
|
card_charge_company_id,
|
|||
|
card_charge_company_number,
|
|||
|
card_charge_status,
|
|||
|
card_charge_remark,
|
|||
|
card_charge_user_id,
|
|||
|
card_charge_invitation_user_id,
|
|||
|
card_charge_order_number,
|
|||
|
card_charge_order_status,
|
|||
|
card_charge_order_time,
|
|||
|
card_template_id,
|
|||
|
creator,
|
|||
|
gmt_create,
|
|||
|
modifier,
|
|||
|
gmt_modified,
|
|||
|
is_delete
|
|||
|
) VALUES(
|
|||
|
#{cardChargeId},
|
|||
|
#{cardChargePrice},
|
|||
|
#{cardChargeEnd},
|
|||
|
#{cardChargeMode},
|
|||
|
#{cardChargeCompanyId},
|
|||
|
#{cardChargeCompanyNumber},
|
|||
|
#{cardChargeStatus},
|
|||
|
#{cardChargeRemark},
|
|||
|
#{cardChargeUserId},
|
|||
|
#{cardChargeInvitationUserId},
|
|||
|
#{cardChargeOrderNumber},
|
|||
|
#{cardChargeOrderStatus},
|
|||
|
#{cardChargeOrderTime},
|
|||
|
#{cardTemplateId},
|
|||
|
#{creator},
|
|||
|
#{gmtCreate},
|
|||
|
#{modifier},
|
|||
|
#{gmtModified},
|
|||
|
#{isDelete}
|
|||
|
)
|
|||
|
</insert>
|
|||
|
|
|||
|
<!-- 删除CBC名片收费记录表 -->
|
|||
|
<update id="remove" parameterType="map">
|
|||
|
UPDATE
|
|||
|
e_card_charge
|
|||
|
SET
|
|||
|
gmt_modified = #{gmtModified},
|
|||
|
modifier = #{modifier},
|
|||
|
is_delete = 1
|
|||
|
WHERE
|
|||
|
card_charge_id IN
|
|||
|
<foreach collection="cardChargeIds" index="index" open="(" separator="," close=")">
|
|||
|
#{cardChargeIds[${index}]}
|
|||
|
</foreach>
|
|||
|
</update>
|
|||
|
|
|||
|
<!-- 删除CBC名片收费记录表(物理) -->
|
|||
|
<update id="delete" parameterType="map">
|
|||
|
DELETE FROM
|
|||
|
e_card_charge
|
|||
|
WHERE
|
|||
|
card_charge_id IN
|
|||
|
<foreach collection="cardChargeIds" index="index" open="(" separator="," close=")">
|
|||
|
#{cardChargeIds[${index}]}
|
|||
|
</foreach>
|
|||
|
</update>
|
|||
|
|
|||
|
<!-- 修改CBC名片收费记录表 -->
|
|||
|
<update id="update" parameterType="map">
|
|||
|
UPDATE
|
|||
|
e_card_charge
|
|||
|
SET
|
|||
|
<if test="cardChargePrice != null">
|
|||
|
card_charge_price = #{cardChargePrice},
|
|||
|
</if>
|
|||
|
<if test="cardChargeEnd != null and cardChargeEnd != ''">
|
|||
|
card_charge_end = #{cardChargeEnd},
|
|||
|
</if>
|
|||
|
<if test="cardChargeMode != null and cardChargeMode != ''">
|
|||
|
card_charge_mode = #{cardChargeMode},
|
|||
|
</if>
|
|||
|
<if test="cardChargeCompanyId != null and cardChargeCompanyId != ''">
|
|||
|
card_charge_company_id = #{cardChargeCompanyId},
|
|||
|
</if>
|
|||
|
<if test="cardChargeCompanyNumber != null">
|
|||
|
card_charge_company_number = #{cardChargeCompanyNumber},
|
|||
|
</if>
|
|||
|
<if test="cardChargeStatus != null and cardChargeStatus != ''">
|
|||
|
card_charge_status = #{cardChargeStatus},
|
|||
|
</if>
|
|||
|
<if test="cardChargeRemark != null and cardChargeRemark != ''">
|
|||
|
card_charge_remark = #{cardChargeRemark},
|
|||
|
</if>
|
|||
|
<if test="cardChargeUserId != null and cardChargeUserId != ''">
|
|||
|
card_charge_user_id = #{cardChargeUserId},
|
|||
|
</if>
|
|||
|
<if test="cardChargeInvitationUserId != null and cardChargeInvitationUserId != ''">
|
|||
|
card_charge_invitation_user_id = #{cardChargeInvitationUserId},
|
|||
|
</if>
|
|||
|
<if test="cardChargeOrderNumber != null and cardChargeOrderNumber != ''">
|
|||
|
card_charge_order_number = #{cardChargeOrderNumber},
|
|||
|
</if>
|
|||
|
<if test="cardTemplateId != null and cardTemplateId != ''">
|
|||
|
card_template_id = #{cardTemplateId},
|
|||
|
</if>
|
|||
|
gmt_modified = #{gmtModified},
|
|||
|
modifier = #{modifier},
|
|||
|
card_charge_id = card_charge_id
|
|||
|
WHERE
|
|||
|
card_charge_id = #{cardChargeId}
|
|||
|
</update>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表详情 -->
|
|||
|
<select id="get" parameterType="map" resultMap="cardChargeDTO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t1.card_charge_invitation_user_id,
|
|||
|
t1.card_charge_order_number,
|
|||
|
t1.card_charge_order_status,
|
|||
|
t1.card_charge_order_time,
|
|||
|
t1.card_template_id
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
<if test="cardChargeId != null and cardChargeId != ''">
|
|||
|
AND
|
|||
|
t1.card_charge_id = #{cardChargeId}
|
|||
|
</if>
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表详情 -->
|
|||
|
<select id="getBO" parameterType="map" resultMap="cardChargeBO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t1.creator,
|
|||
|
t1.gmt_create,
|
|||
|
t1.modifier,
|
|||
|
t1.gmt_modified,
|
|||
|
t1.is_delete
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
<if test="cardChargeId != null and cardChargeId != ''">
|
|||
|
AND
|
|||
|
t1.card_charge_id = #{cardChargeId}
|
|||
|
</if>
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表详情 -->
|
|||
|
<select id="getPO" parameterType="map" resultMap="cardChargePO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t1.creator,
|
|||
|
t1.gmt_create,
|
|||
|
t1.modifier,
|
|||
|
t1.gmt_modified,
|
|||
|
t1.is_delete
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
<if test="cardChargeId != null and cardChargeId != ''">
|
|||
|
AND
|
|||
|
t1.card_charge_id = #{cardChargeId}
|
|||
|
</if>
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表列表 -->
|
|||
|
<select id="list" parameterType="map" resultMap="cardChargeDTO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t2.user_username,
|
|||
|
t1.card_charge_invitation_user_id,
|
|||
|
t1.creator,
|
|||
|
t1.gmt_create,
|
|||
|
t1.modifier,
|
|||
|
t1.gmt_modified,
|
|||
|
t1.is_delete,
|
|||
|
t1.card_charge_order_number,
|
|||
|
t1.card_template_id
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
LEFT JOIN
|
|||
|
sys_user t2
|
|||
|
ON
|
|||
|
t1.card_charge_user_id = t2.user_id
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
<if test="keywords != null and keywords != ''">
|
|||
|
AND (
|
|||
|
<!-- 这里添加其他条件 -->
|
|||
|
t2.user_username LIKE CONCAT('%', #{keywords}, '%')
|
|||
|
OR
|
|||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|||
|
)
|
|||
|
</if>
|
|||
|
<if test="startTime != null and startTime != ''">
|
|||
|
AND
|
|||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|||
|
</if>
|
|||
|
<if test="endTime != null and endTime != ''">
|
|||
|
AND
|
|||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|||
|
</if>
|
|||
|
<if test="cardChargeIds != null and cardChargeIds.size > 0">
|
|||
|
AND
|
|||
|
t1.card_charge_id IN
|
|||
|
<foreach collection="cardChargeIds" index="index" open="(" separator="," close=")">
|
|||
|
#{cardChargeIds[${index}]}
|
|||
|
</foreach>
|
|||
|
</if>
|
|||
|
ORDER BY t1.gmt_create DESC
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表列表 -->
|
|||
|
<select id="listBO" parameterType="map" resultMap="cardChargeBO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t1.creator,
|
|||
|
t1.gmt_create,
|
|||
|
t1.modifier,
|
|||
|
t1.gmt_modified,
|
|||
|
t1.is_delete,
|
|||
|
t1.card_template_id
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
<if test="keywords != null and keywords != ''">
|
|||
|
AND (
|
|||
|
<!-- 这里添加其他条件 -->
|
|||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|||
|
)
|
|||
|
</if>
|
|||
|
<if test="startTime != null and startTime != ''">
|
|||
|
AND
|
|||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|||
|
</if>
|
|||
|
<if test="endTime != null and endTime != ''">
|
|||
|
AND
|
|||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|||
|
</if>
|
|||
|
<if test="cardChargeIds != null and cardChargeIds.size > 0">
|
|||
|
AND
|
|||
|
t1.card_charge_id IN
|
|||
|
<foreach collection="cardChargeIds" index="index" open="(" separator="," close=")">
|
|||
|
#{cardChargeIds[${index}]}
|
|||
|
</foreach>
|
|||
|
</if>
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表列表 -->
|
|||
|
<select id="listPO" parameterType="map" resultMap="cardChargePO">
|
|||
|
SELECT
|
|||
|
t1.card_charge_id,
|
|||
|
t1.card_charge_price,
|
|||
|
t1.card_charge_end,
|
|||
|
t1.card_charge_mode,
|
|||
|
t1.card_charge_company_id,
|
|||
|
t1.card_charge_company_number,
|
|||
|
t1.card_charge_status,
|
|||
|
t1.card_charge_remark,
|
|||
|
t1.card_charge_user_id,
|
|||
|
t1.creator,
|
|||
|
t1.gmt_create,
|
|||
|
t1.modifier,
|
|||
|
t1.gmt_modified,
|
|||
|
t1.is_delete,
|
|||
|
t1.card_template_id
|
|||
|
FROM
|
|||
|
e_card_charge t1,
|
|||
|
LEFT JOIN
|
|||
|
sys_user t2
|
|||
|
ON
|
|||
|
t1.card_charge_user_id = t2.user_id
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
<if test="keywords != null and keywords != ''">
|
|||
|
AND (
|
|||
|
<!-- 这里添加其他条件 -->
|
|||
|
t2.user_username LIKE CONCAT('%', #{keywords}, '%')
|
|||
|
OR
|
|||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
|||
|
)
|
|||
|
</if>
|
|||
|
<if test="startTime != null and startTime != ''">
|
|||
|
AND
|
|||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|||
|
</if>
|
|||
|
<if test="endTime != null and endTime != ''">
|
|||
|
AND
|
|||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|||
|
</if>
|
|||
|
<if test="cardChargeIds != null and cardChargeIds.size > 0">
|
|||
|
AND
|
|||
|
t1.card_charge_id IN
|
|||
|
<foreach collection="cardChargeIds" index="index" open="(" separator="," close=")">
|
|||
|
#{cardChargeIds[${index}]}
|
|||
|
</foreach>
|
|||
|
</if>
|
|||
|
</select>
|
|||
|
|
|||
|
<!-- CBC名片收费记录表统计 -->
|
|||
|
<select id="count" parameterType="map" resultType="Integer">
|
|||
|
SELECT
|
|||
|
COUNT(*)
|
|||
|
FROM
|
|||
|
e_card_charge t1
|
|||
|
WHERE
|
|||
|
t1.is_delete = 0
|
|||
|
</select>
|
|||
|
|
|||
|
</mapper>
|