system-operator/src/main/resources/mybatis/mapper/user/expand/user-expand.xml

134 lines
5.3 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.operator.dao.user.expand.IUserExpandDao">
<resultMap id="userExpandDTO" type="cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO">
<result column="user_id" property="userId"/>
<result column="price_additional_pkg" property="priceAdditionalPkg"/>
<result column="price_additional_video_demo" property="priceAdditionalVideoDemo"/>
<result column="price_additional_urgent" property="priceAdditionalUrgent"/>
<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"/>
<result column="available_proj_type" property="availableProjType"/>
<result column="postpaid" property="postpaid"/>
<result column="postpaid_count" property="postpaidCount"/>
<result column="free_proj_count" property="freeProjCount"/>
<result column="correction_count" property="correctionCount"/>
</resultMap>
<resultMap id="userExpandPO" type="cn.com.tenlion.operator.pojo.pos.user.expand.UserExpandPO">
<result column="user_id" property="userId"/>
<result column="price_additional_pkg" property="priceAdditionalPkg"/>
<result column="price_additional_video_demo" property="priceAdditionalVideoDemo"/>
<result column="price_additional_urgent" property="priceAdditionalUrgent"/>
<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"/>
<result column="available_proj_type" property="availableProjType"/>
<result column="postpaid" property="postpaid"/>
<result column="postpaid_count" property="postpaidCount"/>
<result column="free_proj_count" property="freeProjCount"/>
<result column="correction_count" property="correctionCount"/>
</resultMap>
<insert id="save" parameterType="map">
INSERT INTO sys_user_expand (
user_id,
price_additional_pkg,
price_additional_video_demo,
price_additional_urgent,
price_all,
price_material,
price_material_agent,
price_material_agent_urgent,
available_proj_type,
postpaid,
postpaid_count,
free_proj_count,
correction_count
) VALUES (
#{userId},
#{priceAdditionalPkg},
#{priceAdditionalVideoDemo},
#{priceAdditionalUrgent},
#{priceAll},
#{priceMaterial},
#{priceMaterialAgent},
#{priceMaterialAgentUrgent},
#{availableProjType},
#{postpaid},
#{postpaidCount},
#{freeProjCount},
#{correctionCount}
)
</insert>
<update id="update" parameterType="map">
UPDATE
sys_user_expand
SET
price_additional_pkg = #{priceAdditionalPkg},
price_additional_video_demo = #{priceAdditionalVideoDemo},
price_additional_urgent = #{priceAdditionalUrgent},
price_all = #{priceAll},
price_material = #{priceMaterial},
price_material_agent = #{priceMaterialAgent},
price_material_agent_urgent = #{priceMaterialAgentUrgent},
available_proj_type = #{availableProjType},
postpaid = #{postpaid},
postpaid_count = #{postpaidCount},
free_proj_count = #{freeProjCount},
correction_count = #{correctionCount}
WHERE
user_id = #{userId}
</update>
<select id="get" parameterType="map" resultMap="userExpandDTO">
SELECT
price_additional_pkg,
price_additional_video_demo,
price_additional_urgent,
price_all,
price_material,
price_material_agent,
price_material_agent_urgent,
available_proj_type,
postpaid,
postpaid_count,
free_proj_count,
correction_count
FROM
sys_user_expand
WHERE
<if test="userId != null and userId != ''">
user_id = #{userId}
</if>
</select>
<select id="getPO" parameterType="map" resultMap="userExpandPO">
SELECT
user_id,
price_additional_pkg,
price_additional_video_demo,
price_additional_urgent,
price_all,
price_material,
price_material_agent,
price_material_agent_urgent,
available_proj_type,
postpaid,
postpaid_count,
free_proj_count,
correction_count
FROM
sys_user_expand
WHERE
<if test="userId != null and userId != ''">
user_id = #{userId}
</if>
</select>
</mapper>