You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

353 lines
23 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.sztzjy.money_management.mapper.SynthesisPlanScoreMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.money_management.entity.SynthesisPlanScore">
<id column="synthesis_plan_id" jdbcType="VARCHAR" property="synthesisPlanId"/>
<id column="caseid" jdbcType="VARCHAR" property="caseid"/>
<id column="userid" jdbcType="VARCHAR" property="userid"/>
<result column="manage_money_matters_type" jdbcType="VARCHAR" property="manageMoneyMattersType"/>
<result column="test_center" jdbcType="VARCHAR" property="testCenter"/>
<result column="status" jdbcType="CHAR" property="status"/>
<result column="score" jdbcType="DECIMAL" property="score"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
type="com.sztzjy.money_management.entity.SynthesisPlanScoreWithBLOBs">
<result column="case_answer" jdbcType="LONGVARCHAR" property="caseAnswer"/>
<result column="stu_answer" jdbcType="LONGVARCHAR" property="stuAnswer"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
synthesis_plan_id
, caseid, userid, manage_money_matters_type, test_center, status,
score
</sql>
<sql id="Blob_Column_List">
case_answer
, stu_answer
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from synthesis_plan_score
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from synthesis_plan_score
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreKey"
resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from synthesis_plan_score
where synthesis_plan_id = #{synthesisPlanId,jdbcType=VARCHAR}
and caseid = #{caseid,jdbcType=VARCHAR}
and userid = #{userid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreKey">
delete
from synthesis_plan_score
where synthesis_plan_id = #{synthesisPlanId,jdbcType=VARCHAR}
and caseid = #{caseid,jdbcType=VARCHAR}
and userid = #{userid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreExample">
delete from synthesis_plan_score
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreWithBLOBs">
insert into synthesis_plan_score (synthesis_plan_id, caseid, userid,
manage_money_matters_type, test_center, status,
score, case_answer, stu_answer)
values (#{synthesisPlanId,jdbcType=VARCHAR}, #{caseid,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR},
#{manageMoneyMattersType,jdbcType=VARCHAR}, #{testCenter,jdbcType=VARCHAR}, #{status,jdbcType=CHAR},
#{score,jdbcType=DECIMAL}, #{caseAnswer,jdbcType=LONGVARCHAR}, #{stuAnswer,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreWithBLOBs">
insert into synthesis_plan_score
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="synthesisPlanId != null">
synthesis_plan_id,
</if>
<if test="caseid != null">
caseid,
</if>
<if test="userid != null">
userid,
</if>
<if test="manageMoneyMattersType != null">
manage_money_matters_type,
</if>
<if test="testCenter != null">
test_center,
</if>
<if test="status != null">
status,
</if>
<if test="score != null">
score,
</if>
<if test="caseAnswer != null">
case_answer,
</if>
<if test="stuAnswer != null">
stu_answer,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="synthesisPlanId != null">
#{synthesisPlanId,jdbcType=VARCHAR},
</if>
<if test="caseid != null">
#{caseid,jdbcType=VARCHAR},
</if>
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="manageMoneyMattersType != null">
#{manageMoneyMattersType,jdbcType=VARCHAR},
</if>
<if test="testCenter != null">
#{testCenter,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=CHAR},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="caseAnswer != null">
#{caseAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="stuAnswer != null">
#{stuAnswer,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreExample"
resultType="java.lang.Long">
select count(*) from synthesis_plan_score
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update synthesis_plan_score
<set>
<if test="record.synthesisPlanId != null">
synthesis_plan_id = #{record.synthesisPlanId,jdbcType=VARCHAR},
</if>
<if test="record.caseid != null">
caseid = #{record.caseid,jdbcType=VARCHAR},
</if>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.manageMoneyMattersType != null">
manage_money_matters_type = #{record.manageMoneyMattersType,jdbcType=VARCHAR},
</if>
<if test="record.testCenter != null">
test_center = #{record.testCenter,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=CHAR},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.caseAnswer != null">
case_answer = #{record.caseAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="record.stuAnswer != null">
stu_answer = #{record.stuAnswer,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update synthesis_plan_score
set synthesis_plan_id = #{record.synthesisPlanId,jdbcType=VARCHAR},
caseid = #{record.caseid,jdbcType=VARCHAR},
userid = #{record.userid,jdbcType=VARCHAR},
manage_money_matters_type = #{record.manageMoneyMattersType,jdbcType=VARCHAR},
test_center = #{record.testCenter,jdbcType=VARCHAR},
status = #{record.status,jdbcType=CHAR},
score = #{record.score,jdbcType=DECIMAL},
case_answer = #{record.caseAnswer,jdbcType=LONGVARCHAR},
stu_answer = #{record.stuAnswer,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update synthesis_plan_score
set synthesis_plan_id = #{record.synthesisPlanId,jdbcType=VARCHAR},
caseid = #{record.caseid,jdbcType=VARCHAR},
userid = #{record.userid,jdbcType=VARCHAR},
manage_money_matters_type = #{record.manageMoneyMattersType,jdbcType=VARCHAR},
test_center = #{record.testCenter,jdbcType=VARCHAR},
status = #{record.status,jdbcType=CHAR},
score = #{record.score,jdbcType=DECIMAL}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective"
parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreWithBLOBs">
update synthesis_plan_score
<set>
<if test="manageMoneyMattersType != null">
manage_money_matters_type = #{manageMoneyMattersType,jdbcType=VARCHAR},
</if>
<if test="testCenter != null">
test_center = #{testCenter,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=CHAR},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="caseAnswer != null">
case_answer = #{caseAnswer,jdbcType=LONGVARCHAR},
</if>
<if test="stuAnswer != null">
stu_answer = #{stuAnswer,jdbcType=LONGVARCHAR},
</if>
</set>
where synthesis_plan_id = #{synthesisPlanId,jdbcType=VARCHAR}
and caseid = #{caseid,jdbcType=VARCHAR}
and userid = #{userid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs"
parameterType="com.sztzjy.money_management.entity.SynthesisPlanScoreWithBLOBs">
update synthesis_plan_score
set manage_money_matters_type = #{manageMoneyMattersType,jdbcType=VARCHAR},
test_center = #{testCenter,jdbcType=VARCHAR},
status = #{status,jdbcType=CHAR},
score = #{score,jdbcType=DECIMAL},
case_answer = #{caseAnswer,jdbcType=LONGVARCHAR},
stu_answer = #{stuAnswer,jdbcType=LONGVARCHAR}
where synthesis_plan_id = #{synthesisPlanId,jdbcType=VARCHAR}
and caseid = #{caseid,jdbcType=VARCHAR}
and userid = #{userid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.money_management.entity.SynthesisPlanScore">
update synthesis_plan_score
set manage_money_matters_type = #{manageMoneyMattersType,jdbcType=VARCHAR},
test_center = #{testCenter,jdbcType=VARCHAR},
status = #{status,jdbcType=CHAR},
score = #{score,jdbcType=DECIMAL}
where synthesis_plan_id = #{synthesisPlanId,jdbcType=VARCHAR}
and caseid = #{caseid,jdbcType=VARCHAR}
and userid = #{userid,jdbcType=VARCHAR}
</update>
<insert id="batchInsert">
insert into synthesis_plan_score (synthesis_plan_id, caseid, userid,
manage_money_matters_type, test_center, status,
score, case_answer, stu_answer)
values
<foreach collection="list" item="item" separator=",">
(#{item.synthesisPlanId,jdbcType=VARCHAR}, #{item.caseid,jdbcType=VARCHAR}, #{item.userid,jdbcType=VARCHAR},
#{item.manageMoneyMattersType,jdbcType=VARCHAR}, #{item.testCenter,jdbcType=VARCHAR}, #{item.status,jdbcType=CHAR},
#{item.score,jdbcType=DECIMAL}, #{item.caseAnswer,jdbcType=LONGVARCHAR}, #{item.stuAnswer,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<select id="selectByExampleWithBLOBsAndOrder" resultMap="ResultMapWithBLOBs">
SELECT * FROM synthesis_plan_score
WHERE caseid = #{caseId} AND userid = #{userId}
ORDER BY
FIELD(manage_money_matters_type, '客户信息','风险测评-风险指标','财务分析-资产负债表','财务分析-收支储蓄表','财务分析-现金流量表','财务分析-财务比例分析','现金规划','生涯规划-教育规划','生涯规划-消费规划','生涯规划-创业规划','生涯规划-退休规划','生涯规划-保险规划','投资规划','税务筹划','财产分配','财产传承'),
FIELD(test_center, '姓名', '年龄', '证件号码', '客户得分-年龄', '客户得分-就业状况','客户得分-家庭负担','客户得分-置产状况','客户得分-投资经验','客户得分-投资知识','客户得分-忍受亏损百分比','客户得分-首要考虑','客户得分-认赔动作','客户得分-赔钱心理','客户得分-最重要特性','客户得分-避免工具','现金','人民币银行活存','其他流动资产','人民币银行定存','外币银行定存','股票投资','债券投资','基金投资','实业投资','投资性房地产','保单现金价值','其他投资性资产','自用房地产','自用汽车','自用其他资产','信用卡负债','小额消费信贷','其他消费性负债','金融投资借款','实业投资借款','投资性房地产按揭贷款','其他投资性负债','自用房地产贷款','自用汽车贷款','其他自用贷款','薪资收入','养老保险储蓄','医疗保险储蓄','住房公积金储蓄','其他工作收入','家计支出','子女教育支出','其他支出','利息收入','资本利得','其他理财收入','利息支出','保障型保费支出','其他理财支出','投资现金流量-投资赎回','投资现金流量-新增投资','借贷现金流量-借入本金','借贷现金流量-还款本金','客户财务情况分析','家庭月支出','现金规划分析','子女年龄','国内学费增长率','国外学费增长率','幼儿园教育-求学年龄','幼儿园教育-求学时间','幼儿园教育-目前学费','小学教育-求学年龄','小学教育-求学时间','小学教育-目前学费','初中教育-求学年龄','初中教育-求学时间','初中教育-目前学费','高中教育-求学年龄','高中教育-求学时间','高中教育-目前学费','大学教育-求学年龄','大学教育-求学时间','大学教育-目前学费','留学教育-求学年龄','留学教育-求学时间','留学教育-目前学费','商业保险','储蓄计划','其他安排','教育规划分析','消费目标-购房-距离购房年限','消费目标-购房-总金额','消费目标-购房-首付比例','消费目标-购房-贷款年限','消费目标-购房-贷款利率','消费目标-购车-距离购车年限','消费目标-购车-预计裸车价格','消费目标-购车-首付比例','消费目标-购车-贷款年限','消费目标-购车-贷款利率','消费目标-购车-上牌费用','消费目标-购车-车船使用税','消费目标-购车-商业保险','消费规划分析','计划创业年龄','创业时一次性投入','创业规划分析','退休前通货膨胀率','退休后通货膨胀率','退休后投资收益率','计划退休年龄','希望享有的退休生活年限','目前生活水平','生活满意度','退休后、退休前生活水平折算比例','子女传承费用','社会保险','商业保险','租金收入','其他收入','退休规划分析','寿险需求测算方法选择-遗属需求法-弥补遗属需求的寿险需求-姓名-配偶','寿险需求测算方法选择-遗属需求法-被保险人年龄-配偶','寿险需求测算方法选择-遗属需求法-预计退休年龄-客户','寿险需求测算方法选择-遗属需求法-预计退休年龄-配偶','寿险需求测算方法选择-遗属需求法-投资报酬率-客户','寿险需求测算方法选择-遗属需求法-投资报酬率-配偶','寿险需求测算方法选择-遗属需求法-通货膨胀率-客户','寿险需求测算方法选择-遗属需求法-通货膨胀率-配偶','寿险需求测算方法选择-遗属需求法-收入增长率-客户','寿险需求测算方法选择-遗属需求法-收入增长率-配偶','寿险需求测算方法选择-遗属需求法-当前的家庭生活费用-客户','寿险需求测算方法选择-遗属需求法-当前的家庭生活费用-配偶','寿险需求测算方法选择-遗属需求法-保险事故发生后支出调整率-客户','寿险需求测算方法选择-遗属需求法-保险事故发生后支出调整率-配偶','寿险需求测算方法选择-遗属需求法-配偶的个人年收入-客户','寿险需求测算方法选择-遗属需求法-配偶的个人年收入-配偶','寿险需求测算方法选择-遗属需求法-临终及丧葬支出现值-客户','寿险需求测算方法选择-遗属需求法-临终及丧葬支出现值-配偶','寿险需求测算方法选择-遗属需求法-目前贷款余额-客户','寿险需求测算方法选择-遗属需求法-目前贷款余额-配偶','寿险需求测算方法选择-遗属需求法-家庭生息资产-客户','寿险需求测算方法选择-遗属需求法-家庭生息资产-配偶','寿险需求测算方法选择-遗属需求法-已有额度-客户','寿险需求测算方法选择-遗属需求法-已有额度-配偶','寿险需求测算方法选择-遗属需求法-预算金额-客户','寿险需求测算方法选择-遗属需求法-预算金额-配偶','寿险需求测算方法选择-遗属需求法-补充额度-客户','寿险需求测算方法选择-遗属需求法-补充额度-配偶','寿险需求测算方法选择-遗属需求法-保险规划分析','寿险需求测算方法选择-生命价值法-预计退休年龄','寿险需求测算方法选择-生命价值法-投资报酬率','寿险需求测算方法选择-生命价值法-当前个人年收入','寿险需求测算方法选择-生命价值法-收入增长率','寿险需求测算方法选择-生命价值法-当前个人年支出','寿险需求测算方法选择-生命价值法-年通货膨胀率','寿险需求测算方法选择-生命价值法-已有额度','寿险需求测算方法选择-生命价值法-预算金额','寿险需求测算方法选择-生命价值法-补充额度','寿险需求测算方法选择-生命价值法-保险规划分析','理财方案','当前客户所处家庭生命周期','产品选择','投资规划分析','工资、薪金所得','个体工商户的生产、经营所得','对企事业单位承包、承租经营所得','劳务报酬所得','稿酬所得','特许权使用费所得','财产转让所得','偶然所得','利息、红利、股利所得','税务筹划分析','婚姻、财产状况分析','财产分配规划分析','银行存款','人寿保单赔偿金额','其他现金账户','股票','债券','基金','其他投资收益','养老金(一次性收入现值)','配偶/遗孤年金收益(现值)','其他退休基金','房产','汽车','其他个人资产','其他资产','短期贷款','中期贷款','长期贷款','其他贷款','临终医疗费用','预期收入纳税额支出','丧葬费用','遗产处理费用','其他费用','其他负债','财务分析','财产传承规划分析')
</select>
</mapper>