2024-06-11 16:05:23 +08:00
|
|
|
<?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.operator.dao.user.expand.IUserExpandDao">
|
|
|
|
|
|
|
|
<resultMap id="userExpandDTO" type="cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO">
|
2024-07-25 18:44:39 +08:00
|
|
|
<result column="user_id" property="userId"/>
|
2024-06-11 16:05:23 +08:00
|
|
|
<result column="price_additional_pkg" property="priceAdditionalPkg"/>
|
|
|
|
<result column="price_additional_video_demo" property="priceAdditionalVideoDemo"/>
|
2024-07-29 10:34:31 +08:00
|
|
|
<result column="price_additional_urgent" property="priceAdditionalUrgent"/>
|
2024-06-11 16:05:23 +08:00
|
|
|
<result column="price_all" property="priceAll"/>
|
|
|
|
<result column="price_material" property="priceMaterial"/>
|
|
|
|
<result column="price_material_agent" property="priceMaterialAgent"/>
|
|
|
|
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
2024-06-14 14:27:09 +08:00
|
|
|
<result column="available_proj_type" property="availableProjType"/>
|
|
|
|
<result column="postpaid" property="postpaid"/>
|
2024-06-18 18:55:43 +08:00
|
|
|
<result column="postpaid_count" property="postpaidCount"/>
|
2024-06-14 14:27:09 +08:00
|
|
|
<result column="free_proj_count" property="freeProjCount"/>
|
|
|
|
<result column="correction_count" property="correctionCount"/>
|
2024-08-08 10:29:21 +08:00
|
|
|
<result column="ic" property="ic"/>
|
|
|
|
<result column="ic_rebate_ratio" property="icRebateRatio"/>
|
|
|
|
<result column="ic_way_to_get" property="icWayToGet"/>
|
|
|
|
<result column="ic_get_time" property="icGetTime"/>
|
|
|
|
<result column="ic_assign_user_id" property="icAssignUserId"/>
|
|
|
|
<result column="relation_ic" property="relationIc"/>
|
|
|
|
<result column="relation_ic_rebate_ratio" property="relationIcRebateRatio"/>
|
|
|
|
<result column="relation_ic_time" property="relationIcTime"/>
|
|
|
|
<result column="relation_ic_user_id" property="relationIcUserId"/>
|
2024-06-11 16:05:23 +08:00
|
|
|
</resultMap>
|
|
|
|
|
2024-06-11 16:50:38 +08:00
|
|
|
<resultMap id="userExpandPO" type="cn.com.tenlion.operator.pojo.pos.user.expand.UserExpandPO">
|
2024-07-25 18:44:39 +08:00
|
|
|
<result column="user_id" property="userId"/>
|
2024-06-11 16:50:38 +08:00
|
|
|
<result column="price_additional_pkg" property="priceAdditionalPkg"/>
|
|
|
|
<result column="price_additional_video_demo" property="priceAdditionalVideoDemo"/>
|
2024-07-29 10:34:31 +08:00
|
|
|
<result column="price_additional_urgent" property="priceAdditionalUrgent"/>
|
2024-06-11 16:50:38 +08:00
|
|
|
<result column="price_all" property="priceAll"/>
|
|
|
|
<result column="price_material" property="priceMaterial"/>
|
|
|
|
<result column="price_material_agent" property="priceMaterialAgent"/>
|
|
|
|
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
2024-06-14 14:27:09 +08:00
|
|
|
<result column="available_proj_type" property="availableProjType"/>
|
|
|
|
<result column="postpaid" property="postpaid"/>
|
2024-06-18 18:55:43 +08:00
|
|
|
<result column="postpaid_count" property="postpaidCount"/>
|
2024-06-14 14:27:09 +08:00
|
|
|
<result column="free_proj_count" property="freeProjCount"/>
|
|
|
|
<result column="correction_count" property="correctionCount"/>
|
2024-08-08 10:29:21 +08:00
|
|
|
<result column="ic" property="ic"/>
|
|
|
|
<result column="ic_rebate_ratio" property="icRebateRatio"/>
|
|
|
|
<result column="ic_way_to_get" property="icWayToGet"/>
|
|
|
|
<result column="ic_get_time" property="icGetTime"/>
|
|
|
|
<result column="ic_assign_user_id" property="icAssignUserId"/>
|
|
|
|
<result column="relation_ic" property="relationIc"/>
|
|
|
|
<result column="relation_ic_rebate_ratio" property="relationIcRebateRatio"/>
|
|
|
|
<result column="relation_ic_time" property="relationIcTime"/>
|
|
|
|
<result column="relation_ic_user_id" property="relationIcUserId"/>
|
2024-06-11 16:50:38 +08:00
|
|
|
</resultMap>
|
|
|
|
|
2024-06-11 16:05:23 +08:00
|
|
|
<insert id="save" parameterType="map">
|
|
|
|
INSERT INTO sys_user_expand (
|
|
|
|
user_id,
|
|
|
|
price_additional_pkg,
|
|
|
|
price_additional_video_demo,
|
2024-07-29 10:34:31 +08:00
|
|
|
price_additional_urgent,
|
2024-06-11 16:05:23 +08:00
|
|
|
price_all,
|
|
|
|
price_material,
|
|
|
|
price_material_agent,
|
2024-06-14 14:27:09 +08:00
|
|
|
price_material_agent_urgent,
|
|
|
|
available_proj_type,
|
|
|
|
postpaid,
|
2024-06-18 18:55:43 +08:00
|
|
|
postpaid_count,
|
2024-06-14 14:27:09 +08:00
|
|
|
free_proj_count,
|
2024-08-08 10:29:21 +08:00
|
|
|
correction_count,
|
|
|
|
ic,
|
|
|
|
ic_rebate_ratio,
|
|
|
|
ic_get_time,
|
|
|
|
ic_assign_user_id
|
2024-06-11 16:05:23 +08:00
|
|
|
) VALUES (
|
|
|
|
#{userId},
|
|
|
|
#{priceAdditionalPkg},
|
|
|
|
#{priceAdditionalVideoDemo},
|
2024-07-29 10:34:31 +08:00
|
|
|
#{priceAdditionalUrgent},
|
2024-06-11 16:05:23 +08:00
|
|
|
#{priceAll},
|
|
|
|
#{priceMaterial},
|
|
|
|
#{priceMaterialAgent},
|
2024-06-14 14:27:09 +08:00
|
|
|
#{priceMaterialAgentUrgent},
|
|
|
|
#{availableProjType},
|
|
|
|
#{postpaid},
|
2024-06-18 18:55:43 +08:00
|
|
|
#{postpaidCount},
|
2024-06-14 14:27:09 +08:00
|
|
|
#{freeProjCount},
|
2024-08-08 10:29:21 +08:00
|
|
|
#{correctionCount},
|
|
|
|
#{ic},
|
|
|
|
#{icRebateRatio},
|
|
|
|
#{icGetTime},
|
|
|
|
#{icAssignUserId}
|
2024-06-11 16:05:23 +08:00
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="update" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
sys_user_expand
|
|
|
|
SET
|
2024-08-08 10:29:21 +08:00
|
|
|
<if test="ic != null and ic != ''">
|
|
|
|
ic = #{ic},
|
|
|
|
</if>
|
|
|
|
<if test="icRebateRatio != null">
|
|
|
|
ic_rebate_ratio = #{icRebateRatio},
|
|
|
|
</if>
|
|
|
|
<if test="icGetTime != null and icGetTime != ''">
|
|
|
|
ic_get_time = #{icGetTime},
|
|
|
|
</if>
|
|
|
|
<if test="icAssignUserId != null and icAssignUserId != ''">
|
|
|
|
ic_assign_user_id = #{icAssignUserId},
|
|
|
|
</if>
|
2024-06-11 16:05:23 +08:00
|
|
|
price_additional_pkg = #{priceAdditionalPkg},
|
|
|
|
price_additional_video_demo = #{priceAdditionalVideoDemo},
|
2024-07-29 10:34:31 +08:00
|
|
|
price_additional_urgent = #{priceAdditionalUrgent},
|
2024-06-11 16:05:23 +08:00
|
|
|
price_all = #{priceAll},
|
|
|
|
price_material = #{priceMaterial},
|
|
|
|
price_material_agent = #{priceMaterialAgent},
|
2024-06-14 14:27:09 +08:00
|
|
|
price_material_agent_urgent = #{priceMaterialAgentUrgent},
|
|
|
|
available_proj_type = #{availableProjType},
|
|
|
|
postpaid = #{postpaid},
|
2024-06-18 18:55:43 +08:00
|
|
|
postpaid_count = #{postpaidCount},
|
2024-06-14 14:27:09 +08:00
|
|
|
free_proj_count = #{freeProjCount},
|
|
|
|
correction_count = #{correctionCount}
|
2024-06-11 16:05:23 +08:00
|
|
|
WHERE
|
|
|
|
user_id = #{userId}
|
|
|
|
</update>
|
|
|
|
|
2024-08-08 10:29:21 +08:00
|
|
|
<update id="updateRelationIc" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
sys_user_expand
|
|
|
|
SET
|
|
|
|
price_all = #{priceAll},
|
|
|
|
price_material = #{priceMaterial},
|
|
|
|
relation_ic = #{relationIc},
|
|
|
|
relation_ic_rebate_ratio = #{relationIcRebateRatio},
|
|
|
|
relation_ic_time = #{relationIcTime},
|
|
|
|
relation_ic_user_id = #{relationIcUserId}
|
|
|
|
WHERE
|
|
|
|
user_id = #{userId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<update id="updateRelationRebateRatio" parameterType="map">
|
|
|
|
UPDATE
|
|
|
|
sys_user_expand
|
|
|
|
SET
|
|
|
|
relation_ic_rebate_ratio = #{relationIcRebateRatio}
|
|
|
|
WHERE
|
|
|
|
relation_ic_user_id = #{relationIcUserId}
|
|
|
|
</update>
|
|
|
|
|
2024-06-11 16:05:23 +08:00
|
|
|
<select id="get" parameterType="map" resultMap="userExpandDTO">
|
|
|
|
SELECT
|
|
|
|
price_additional_pkg,
|
|
|
|
price_additional_video_demo,
|
2024-07-29 10:34:31 +08:00
|
|
|
price_additional_urgent,
|
2024-06-11 16:05:23 +08:00
|
|
|
price_all,
|
|
|
|
price_material,
|
|
|
|
price_material_agent,
|
2024-06-14 14:27:09 +08:00
|
|
|
price_material_agent_urgent,
|
|
|
|
available_proj_type,
|
|
|
|
postpaid,
|
2024-06-18 18:55:43 +08:00
|
|
|
postpaid_count,
|
2024-06-14 14:27:09 +08:00
|
|
|
free_proj_count,
|
2024-08-08 10:29:21 +08:00
|
|
|
correction_count,
|
|
|
|
ic,
|
|
|
|
ic_rebate_ratio,
|
|
|
|
ic_way_to_get,
|
|
|
|
ic_get_time,
|
|
|
|
ic_assign_user_id,
|
|
|
|
relation_ic,
|
|
|
|
relation_ic_rebate_ratio,
|
|
|
|
relation_ic_time,
|
|
|
|
relation_ic_user_id
|
2024-06-11 16:05:23 +08:00
|
|
|
FROM
|
|
|
|
sys_user_expand
|
|
|
|
WHERE
|
|
|
|
<if test="userId != null and userId != ''">
|
|
|
|
user_id = #{userId}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
2024-06-11 16:50:38 +08:00
|
|
|
<select id="getPO" parameterType="map" resultMap="userExpandPO">
|
|
|
|
SELECT
|
2024-07-25 18:44:39 +08:00
|
|
|
user_id,
|
2024-06-11 16:50:38 +08:00
|
|
|
price_additional_pkg,
|
|
|
|
price_additional_video_demo,
|
2024-07-29 10:34:31 +08:00
|
|
|
price_additional_urgent,
|
2024-06-11 16:50:38 +08:00
|
|
|
price_all,
|
|
|
|
price_material,
|
|
|
|
price_material_agent,
|
2024-06-14 14:27:09 +08:00
|
|
|
price_material_agent_urgent,
|
|
|
|
available_proj_type,
|
|
|
|
postpaid,
|
2024-06-18 18:55:43 +08:00
|
|
|
postpaid_count,
|
2024-06-14 14:27:09 +08:00
|
|
|
free_proj_count,
|
2024-08-08 10:29:21 +08:00
|
|
|
correction_count,
|
|
|
|
ic,
|
|
|
|
ic_rebate_ratio,
|
|
|
|
ic_way_to_get,
|
|
|
|
ic_get_time,
|
|
|
|
ic_assign_user_id,
|
|
|
|
relation_ic,
|
|
|
|
relation_ic_rebate_ratio,
|
|
|
|
relation_ic_time,
|
|
|
|
relation_ic_user_id
|
2024-06-11 16:50:38 +08:00
|
|
|
FROM
|
|
|
|
sys_user_expand
|
|
|
|
WHERE
|
|
|
|
<if test="userId != null and userId != ''">
|
|
|
|
user_id = #{userId}
|
|
|
|
</if>
|
2024-08-08 10:29:21 +08:00
|
|
|
<if test="ic != null and ic != ''">
|
|
|
|
ic = #{ic}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="countIc" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
|
SELECT
|
|
|
|
COUNT(ic)
|
|
|
|
FROM
|
|
|
|
sys_user_expand
|
|
|
|
WHERE
|
|
|
|
ic = #{_parameter}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="listUserIdByRelationUserId" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
|
SELECT
|
|
|
|
user_id
|
|
|
|
FROM
|
|
|
|
sys_user_expand
|
|
|
|
WHERE
|
|
|
|
relation_ic_user_id = #{_parameter}
|
2024-06-11 16:50:38 +08:00
|
|
|
</select>
|
|
|
|
|
2024-06-11 16:05:23 +08:00
|
|
|
</mapper>
|