|
@@ -1,216 +1,286 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.TUserProfileMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TUserProfile" id="TUserProfileResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="name" column="name" />
|
|
|
- <result property="gender" column="gender" />
|
|
|
- <result property="sfzid" column="sfzid" />
|
|
|
- <result property="telOne" column="tel_one" />
|
|
|
- <result property="telTwo" column="tel_two" />
|
|
|
- <result property="telThree" column="tel_three" />
|
|
|
- <result property="birthday" column="birthday" />
|
|
|
- <result property="age" column="age" />
|
|
|
- <result property="marrStatus" column="marr_status" />
|
|
|
- <result property="national" column="national" />
|
|
|
- <result property="local" column="local" />
|
|
|
- <result property="clientType" column="client_type" />
|
|
|
- <result property="liveStatus" column="live_status" />
|
|
|
- <result property="familyAddress" column="family_address" />
|
|
|
- <result property="detailAddress" column="detail_address" />
|
|
|
- <result property="houseAddress" column="house_address" />
|
|
|
- <result property="houseDetailAddress" column="house_detail_address" />
|
|
|
- <result property="serviceid" column="serviceid" />
|
|
|
- <result property="oldmenStatus" column="oldmen_status" />
|
|
|
- <result property="changeContent" column="change_content" />
|
|
|
- <result property="loseMonth" column="lose_month" />
|
|
|
- <result property="treatMonth" column="treat_month" />
|
|
|
- <result property="isTreat" column="is_treat" />
|
|
|
- <result property="serviceType" column="service_type" />
|
|
|
- <result property="treateSure" column="treate_sure" />
|
|
|
- <result property="moneyCome" column="money_come" />
|
|
|
- <result property="moneyMonth" column="money_month" />
|
|
|
- <result property="cardCode" column="card_code" />
|
|
|
- <result property="slowIllness" column="slow_illness" />
|
|
|
- <result property="bloodType" column="blood_type" />
|
|
|
- <result property="shiStatus" column="shi_status" />
|
|
|
- <result property="disablityStatus" column="disablity_status" />
|
|
|
- <result property="disablityEntry" column="disablity_entry" />
|
|
|
- <result property="educaLevel" column="educa_level" />
|
|
|
- <result property="special" column="special" />
|
|
|
- <result property="title" column="title" />
|
|
|
- <result property="unity" column="unity" />
|
|
|
- <result property="natureHeart" column="nature_heart" />
|
|
|
- <result property="eatPoint" column="eat_point" />
|
|
|
- <result property="speciality" column="speciality" />
|
|
|
- <result property="hobby" column="hobby" />
|
|
|
- <result property="photo" column="photo" />
|
|
|
- <result property="otherPhoto" column="other_photo" />
|
|
|
- <result property="remarks" column="remarks" />
|
|
|
- <result property="createTime" column="createtime" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ <result property="gender" column="gender"/>
|
|
|
+ <result property="sfzid" column="sfzid"/>
|
|
|
+ <result property="telOne" column="tel_one"/>
|
|
|
+ <result property="telTwo" column="tel_two"/>
|
|
|
+ <result property="telThree" column="tel_three"/>
|
|
|
+ <result property="birthday" column="birthday"/>
|
|
|
+ <result property="age" column="age"/>
|
|
|
+ <result property="marrStatus" column="marr_status"/>
|
|
|
+ <result property="national" column="national"/>
|
|
|
+ <result property="local" column="local"/>
|
|
|
+ <result property="clientType" column="client_type"/>
|
|
|
+ <result property="liveStatus" column="live_status"/>
|
|
|
+ <result property="familyAddress" column="family_address"/>
|
|
|
+ <result property="detailAddress" column="detail_address"/>
|
|
|
+ <result property="houseAddress" column="house_address"/>
|
|
|
+ <result property="houseDetailAddress" column="house_detail_address"/>
|
|
|
+ <result property="serviceid" column="serviceid"/>
|
|
|
+ <result property="oldmenStatus" column="oldmen_status"/>
|
|
|
+ <result property="changeContent" column="change_content"/>
|
|
|
+ <result property="loseMonth" column="lose_month"/>
|
|
|
+ <result property="treatMonth" column="treat_month"/>
|
|
|
+ <result property="isTreat" column="is_treat"/>
|
|
|
+ <result property="serviceType" column="service_type"/>
|
|
|
+ <result property="treateSure" column="treate_sure"/>
|
|
|
+ <result property="moneyCome" column="money_come"/>
|
|
|
+ <result property="moneyMonth" column="money_month"/>
|
|
|
+ <result property="cardCode" column="card_code"/>
|
|
|
+ <result property="slowIllness" column="slow_illness"/>
|
|
|
+ <result property="bloodType" column="blood_type"/>
|
|
|
+ <result property="shiStatus" column="shi_status"/>
|
|
|
+ <result property="disablityStatus" column="disablity_status"/>
|
|
|
+ <result property="disablityEntry" column="disablity_entry"/>
|
|
|
+ <result property="educaLevel" column="educa_level"/>
|
|
|
+ <result property="special" column="special"/>
|
|
|
+ <result property="title" column="title"/>
|
|
|
+ <result property="unity" column="unity"/>
|
|
|
+ <result property="natureHeart" column="nature_heart"/>
|
|
|
+ <result property="eatPoint" column="eat_point"/>
|
|
|
+ <result property="speciality" column="speciality"/>
|
|
|
+ <result property="hobby" column="hobby"/>
|
|
|
+ <result property="photo" column="photo"/>
|
|
|
+ <result property="otherPhoto" column="other_photo"/>
|
|
|
+ <result property="remarks" column="remarks"/>
|
|
|
+ <result property="createTime" column="createtime"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="TUserProfileTEmergentPeopleResult" type="TUserProfile" extends="TUserProfileResult">
|
|
|
- <collection property="tEmergentPeopleList" notNullColumn="sub_id" javaType="java.util.List" resultMap="TEmergentPeopleResult" />
|
|
|
+ <collection property="tEmergentPeopleList" notNullColumn="sub_id" javaType="java.util.List"
|
|
|
+ resultMap="TEmergentPeopleResult"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="TEmergentPeople" id="TEmergentPeopleResult">
|
|
|
- <result property="id" column="sub_id" />
|
|
|
- <result property="profileId" column="sub_profile_id" />
|
|
|
- <result property="name" column="sub_name" />
|
|
|
- <result property="telno" column="sub_telno" />
|
|
|
- <result property="relation" column="sub_relation" />
|
|
|
- <result property="isConn" column="sub_is_conn" />
|
|
|
+ <result property="id" column="sub_id"/>
|
|
|
+ <result property="profileId" column="sub_profile_id"/>
|
|
|
+ <result property="name" column="sub_name"/>
|
|
|
+ <result property="telno" column="sub_telno"/>
|
|
|
+ <result property="relation" column="sub_relation"/>
|
|
|
+ <result property="isConn" column="sub_is_conn"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTUserProfileVo">
|
|
|
- select id, name, gender, sfzid, tel_one, tel_two, tel_three, birthday, age, marr_status, national, local, client_type, live_status, family_address, detail_address, house_address, house_detail_address, serviceid, oldmen_status, change_content, lose_month, treat_month, is_treat, service_type, treate_sure, money_come, money_month, card_code, slow_illness, blood_type, shi_status, disablity_status, disablity_entry, educa_level, special, title, unity, nature_heart, eat_point, speciality, hobby, photo, other_photo, remarks, createtime from t_user_profile
|
|
|
+ select id,
|
|
|
+ name,
|
|
|
+ gender,
|
|
|
+ sfzid,
|
|
|
+ tel_one,
|
|
|
+ tel_two,
|
|
|
+ tel_three,
|
|
|
+ birthday,
|
|
|
+ age,
|
|
|
+ marr_status, national, local, client_type, live_status, family_address, detail_address, house_address, house_detail_address, serviceid, oldmen_status, change_content, lose_month, treat_month, is_treat, service_type, treate_sure, money_come, money_month, card_code, slow_illness, blood_type, shi_status, disablity_status, disablity_entry, educa_level, special, title, unity, nature_heart, eat_point, speciality, hobby, photo, other_photo, remarks, createtime
|
|
|
+ from t_user_profile
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTUserProfileList" parameterType="TUserProfile" resultMap="TUserProfileResult">
|
|
|
<include refid="selectTUserProfileVo"/>
|
|
|
- <where>
|
|
|
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
- <if test="gender != null "> and gender = #{gender}</if>
|
|
|
- <if test="sfzid != null and sfzid != ''"> and sfzid = #{sfzid}</if>
|
|
|
- <if test="telOne != null and telOne != ''"> and tel_one = #{telOne}</if>
|
|
|
- <if test="telTwo != null and telTwo != ''"> and tel_two = #{telTwo}</if>
|
|
|
- <if test="telThree != null and telThree != ''"> and tel_three = #{telThree}</if>
|
|
|
- <if test="birthday != null and birthday != ''"> and birthday = #{birthday}</if>
|
|
|
- <if test="age != null "> and age = #{age}</if>
|
|
|
- <if test="marrStatus != null "> and marr_status = #{marrStatus}</if>
|
|
|
- <if test="national != null "> and national = #{national}</if>
|
|
|
- <if test="local != null "> and local = #{local}</if>
|
|
|
- <if test="clientType != null "> and client_type = #{clientType}</if>
|
|
|
- <if test="liveStatus != null "> and live_status = #{liveStatus}</if>
|
|
|
- <if test="familyAddress != null and familyAddress != ''"> and family_address = #{familyAddress}</if>
|
|
|
- <if test="detailAddress != null and detailAddress != ''"> and detail_address = #{detailAddress}</if>
|
|
|
- <if test="houseAddress != null and houseAddress != ''"> and house_address = #{houseAddress}</if>
|
|
|
- <if test="houseDetailAddress != null and houseDetailAddress != ''"> and house_detail_address = #{houseDetailAddress}</if>
|
|
|
- <if test="serviceid != null "> and serviceid = #{serviceid}</if>
|
|
|
- <if test="oldmenStatus != null and oldmenStatus != ''"> and oldmen_status = #{oldmenStatus}</if>
|
|
|
- <if test="changeContent != null and changeContent != ''"> and change_content = #{changeContent}</if>
|
|
|
- <if test="loseMonth != null and loseMonth != ''"> and lose_month = #{loseMonth}</if>
|
|
|
- <if test="treatMonth != null and treatMonth != ''"> and treat_month = #{treatMonth}</if>
|
|
|
- <if test="isTreat != null "> and is_treat = #{isTreat}</if>
|
|
|
- <if test="serviceType != null "> and service_type = #{serviceType}</if>
|
|
|
- <if test="treateSure != null "> and treate_sure = #{treateSure}</if>
|
|
|
- <if test="moneyCome != null "> and money_come = #{moneyCome}</if>
|
|
|
- <if test="moneyMonth != null and moneyMonth != ''"> and money_month = #{moneyMonth}</if>
|
|
|
- <if test="cardCode != null and cardCode != ''"> and card_code = #{cardCode}</if>
|
|
|
- <if test="slowIllness != null and slowIllness != ''"> and slow_illness = #{slowIllness}</if>
|
|
|
- <if test="bloodType != null "> and blood_type = #{bloodType}</if>
|
|
|
- <if test="shiStatus != null "> and shi_status = #{shiStatus}</if>
|
|
|
- <if test="disablityStatus != null "> and disablity_status = #{disablityStatus}</if>
|
|
|
- <if test="disablityEntry != null "> and disablity_entry = #{disablityEntry}</if>
|
|
|
- <if test="educaLevel != null "> and educa_level = #{educaLevel}</if>
|
|
|
- <if test="special != null and special != ''"> and special = #{special}</if>
|
|
|
- <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
- <if test="unity != null and unity != ''"> and unity = #{unity}</if>
|
|
|
- <if test="natureHeart != null and natureHeart != ''"> and nature_heart = #{natureHeart}</if>
|
|
|
- <if test="eatPoint != null and eatPoint != ''"> and eat_point = #{eatPoint}</if>
|
|
|
- <if test="speciality != null and speciality != ''"> and speciality = #{speciality}</if>
|
|
|
- <if test="hobby != null and hobby != ''"> and hobby = #{hobby}</if>
|
|
|
- <if test="photo != null and photo != ''"> and photo = #{photo}</if>
|
|
|
- <if test="otherPhoto != null and otherPhoto != ''"> and other_photo = #{otherPhoto}</if>
|
|
|
- <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
|
|
- <if test="createTime != null "> and createtime = #{createTime}</if>
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="gender != null ">and gender = #{gender}</if>
|
|
|
+ <if test="sfzid != null and sfzid != ''">and sfzid = #{sfzid}</if>
|
|
|
+ <if test="telOne != null and telOne != ''">and tel_one = #{telOne}</if>
|
|
|
+ <if test="telTwo != null and telTwo != ''">and tel_two = #{telTwo}</if>
|
|
|
+ <if test="telThree != null and telThree != ''">and tel_three = #{telThree}</if>
|
|
|
+ <if test="birthday != null and birthday != ''">and birthday = #{birthday}</if>
|
|
|
+ <if test="age != null ">and age = #{age}</if>
|
|
|
+ <if test="marrStatus != null ">and marr_status = #{marrStatus}</if>
|
|
|
+ <if test="national != null ">and national = #{national}</if>
|
|
|
+ <if test="local != null ">and local = #{local}</if>
|
|
|
+ <if test="clientType != null ">and client_type = #{clientType}</if>
|
|
|
+ <if test="liveStatus != null ">and live_status = #{liveStatus}</if>
|
|
|
+ <if test="familyAddress != null and familyAddress != ''">and family_address = #{familyAddress}</if>
|
|
|
+ <if test="detailAddress != null and detailAddress != ''">and detail_address = #{detailAddress}</if>
|
|
|
+ <if test="houseAddress != null and houseAddress != ''">and house_address = #{houseAddress}</if>
|
|
|
+ <if test="houseDetailAddress != null and houseDetailAddress != ''">and house_detail_address =
|
|
|
+ #{houseDetailAddress}
|
|
|
+ </if>
|
|
|
+ <if test="serviceid != null ">and serviceid = #{serviceid}</if>
|
|
|
+ <if test="oldmenStatus != null and oldmenStatus != ''">and oldmen_status = #{oldmenStatus}</if>
|
|
|
+ <if test="changeContent != null and changeContent != ''">and change_content = #{changeContent}</if>
|
|
|
+ <if test="loseMonth != null and loseMonth != ''">and lose_month = #{loseMonth}</if>
|
|
|
+ <if test="treatMonth != null and treatMonth != ''">and treat_month = #{treatMonth}</if>
|
|
|
+ <if test="isTreat != null ">and is_treat = #{isTreat}</if>
|
|
|
+ <if test="serviceType != null ">and service_type = #{serviceType}</if>
|
|
|
+ <if test="treateSure != null ">and treate_sure = #{treateSure}</if>
|
|
|
+ <if test="moneyCome != null ">and money_come = #{moneyCome}</if>
|
|
|
+ <if test="moneyMonth != null and moneyMonth != ''">and money_month = #{moneyMonth}</if>
|
|
|
+ <if test="cardCode != null and cardCode != ''">and card_code = #{cardCode}</if>
|
|
|
+ <if test="slowIllness != null and slowIllness != ''">and slow_illness = #{slowIllness}</if>
|
|
|
+ <if test="bloodType != null ">and blood_type = #{bloodType}</if>
|
|
|
+ <if test="shiStatus != null ">and shi_status = #{shiStatus}</if>
|
|
|
+ <if test="disablityStatus != null ">and disablity_status = #{disablityStatus}</if>
|
|
|
+ <if test="disablityEntry != null ">and disablity_entry = #{disablityEntry}</if>
|
|
|
+ <if test="educaLevel != null ">and educa_level = #{educaLevel}</if>
|
|
|
+ <if test="special != null and special != ''">and special = #{special}</if>
|
|
|
+ <if test="title != null and title != ''">and title = #{title}</if>
|
|
|
+ <if test="unity != null and unity != ''">and unity = #{unity}</if>
|
|
|
+ <if test="natureHeart != null and natureHeart != ''">and nature_heart = #{natureHeart}</if>
|
|
|
+ <if test="eatPoint != null and eatPoint != ''">and eat_point = #{eatPoint}</if>
|
|
|
+ <if test="speciality != null and speciality != ''">and speciality = #{speciality}</if>
|
|
|
+ <if test="hobby != null and hobby != ''">and hobby = #{hobby}</if>
|
|
|
+ <if test="photo != null and photo != ''">and photo = #{photo}</if>
|
|
|
+ <if test="otherPhoto != null and otherPhoto != ''">and other_photo = #{otherPhoto}</if>
|
|
|
+ <if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
|
|
|
+ <if test="createTime != null ">and createtime = #{createTime}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTUserProfileById" parameterType="Integer" resultMap="TUserProfileTEmergentPeopleResult">
|
|
|
- select a.id, a.name, a.gender, a.sfzid, a.tel_one, a.tel_two, a.tel_three, a.birthday, a.age, a.marr_status, a.national, a.local, a.client_type, a.live_status, a.family_address, a.detail_address, a.house_address, a.house_detail_address, a.serviceid, a.oldmen_status, a.change_content, a.lose_month, a.treat_month, a.is_treat, a.service_type, a.treate_sure, a.money_come, a.money_month, a.card_code, a.slow_illness, a.blood_type, a.shi_status, a.disablity_status, a.disablity_entry, a.educa_level, a.special, a.title, a.unity, a.nature_heart, a.eat_point, a.speciality, a.hobby, a.photo, a.other_photo, a.remarks, a.createtime,
|
|
|
- b.id as sub_id, b.profile_id as sub_profile_id, b.name as sub_name, b.telno as sub_telno, b.relation as sub_relation, b.is_conn as sub_is_conn
|
|
|
+ select a.id,
|
|
|
+ a.name,
|
|
|
+ a.gender,
|
|
|
+ a.sfzid,
|
|
|
+ a.tel_one,
|
|
|
+ a.tel_two,
|
|
|
+ a.tel_three,
|
|
|
+ a.birthday,
|
|
|
+ a.age,
|
|
|
+ a.marr_status,
|
|
|
+ a.national,
|
|
|
+ a.local,
|
|
|
+ a.client_type,
|
|
|
+ a.live_status,
|
|
|
+ a.family_address,
|
|
|
+ a.detail_address,
|
|
|
+ a.house_address,
|
|
|
+ a.house_detail_address,
|
|
|
+ a.serviceid,
|
|
|
+ a.oldmen_status,
|
|
|
+ a.change_content,
|
|
|
+ a.lose_month,
|
|
|
+ a.treat_month,
|
|
|
+ a.is_treat,
|
|
|
+ a.service_type,
|
|
|
+ a.treate_sure,
|
|
|
+ a.money_come,
|
|
|
+ a.money_month,
|
|
|
+ a.card_code,
|
|
|
+ a.slow_illness,
|
|
|
+ a.blood_type,
|
|
|
+ a.shi_status,
|
|
|
+ a.disablity_status,
|
|
|
+ a.disablity_entry,
|
|
|
+ a.educa_level,
|
|
|
+ a.special,
|
|
|
+ a.title,
|
|
|
+ a.unity,
|
|
|
+ a.nature_heart,
|
|
|
+ a.eat_point,
|
|
|
+ a.speciality,
|
|
|
+ a.hobby,
|
|
|
+ a.photo,
|
|
|
+ a.other_photo,
|
|
|
+ a.remarks,
|
|
|
+ a.createtime,
|
|
|
+ b.id as sub_id,
|
|
|
+ b.profile_id as sub_profile_id,
|
|
|
+ b.name as sub_name,
|
|
|
+ b.telno as sub_telno,
|
|
|
+ b.relation as sub_relation,
|
|
|
+ b.is_conn as sub_is_conn
|
|
|
from t_user_profile a
|
|
|
- left join t_emergent_people b on b.profile_id = a.id
|
|
|
+ left join t_emergent_people b on b.profile_id = a.id
|
|
|
where a.id = #{id}
|
|
|
</select>
|
|
|
<select id="selectTUserProfileListByDevice" resultType="com.ruoyi.system.domain.dto.TUserProfileDto">
|
|
|
select id, name, gender, sfzid, tel_one, age, family_address from t_user_profile
|
|
|
<where>
|
|
|
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
- <if test="gender != null "> and gender = #{gender}</if>
|
|
|
- <if test="sfzid != null and sfzid != ''"> and sfzid = #{sfzid}</if>
|
|
|
- <if test="telOne != null and telOne != ''"> and tel_one = #{telOne}</if>
|
|
|
- <if test="age != null "> and age = #{age}</if>
|
|
|
- <if test="familyAddress != null and familyAddress != ''"> and family_address = #{familyAddress}</if>
|
|
|
+ <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="gender != null ">and gender = #{gender}</if>
|
|
|
+ <if test="sfzid != null and sfzid != ''">and sfzid = #{sfzid}</if>
|
|
|
+ <if test="telOne != null and telOne != ''">and tel_one = #{telOne}</if>
|
|
|
+ <if test="age != null ">and age = #{age}</if>
|
|
|
+ <if test="familyAddress != null and familyAddress != ''">and family_address = #{familyAddress}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="selectTUserProfileBySfzId" resultType="com.ruoyi.system.domain.TUserProfile">
|
|
|
- select * from t_user_profile
|
|
|
+ select *
|
|
|
+ from t_user_profile
|
|
|
+ where sfzid = #{sfzid}
|
|
|
+ </select>
|
|
|
+ <select id="selectTUserProfileBySfzIdV2" resultType="com.ruoyi.system.domain.TUserProfile">
|
|
|
+ <include refid="selectTUserProfileVo"/>
|
|
|
where sfzid = #{sfzid}
|
|
|
</select>
|
|
|
<select id="selectuserAgeDto" resultType="com.ruoyi.system.domain.dto.UserAgeDto">
|
|
|
- SELECT
|
|
|
- CASE
|
|
|
- WHEN age < 20
|
|
|
- THEN
|
|
|
- '10'
|
|
|
- WHEN age >= 20
|
|
|
- AND age < 30 THEN
|
|
|
- '20'
|
|
|
- WHEN age >= 30
|
|
|
- AND age < 40 THEN
|
|
|
- '30'
|
|
|
- WHEN age >= 40
|
|
|
- AND age < 50 THEN
|
|
|
- '40'
|
|
|
- WHEN age >= 50
|
|
|
- AND age < 60 THEN
|
|
|
- '50'
|
|
|
- WHEN age >= 60
|
|
|
- AND age < 70 THEN
|
|
|
- '60'
|
|
|
- WHEN age >= 70
|
|
|
- AND age < 80 THEN
|
|
|
- '70'
|
|
|
- WHEN age >= 80
|
|
|
- AND age < 90 THEN
|
|
|
- '80'
|
|
|
- WHEN age > 90 THEN
|
|
|
- '100以上'
|
|
|
- END AS age,
|
|
|
- count(*) AS count
|
|
|
+ SELECT CASE
|
|
|
+ WHEN age < 20
|
|
|
+ THEN
|
|
|
+ '10'
|
|
|
+ WHEN age >= 20
|
|
|
+ AND age < 30 THEN
|
|
|
+ '20'
|
|
|
+ WHEN age >= 30
|
|
|
+ AND age < 40 THEN
|
|
|
+ '30'
|
|
|
+ WHEN age >= 40
|
|
|
+ AND age < 50 THEN
|
|
|
+ '40'
|
|
|
+ WHEN age >= 50
|
|
|
+ AND age < 60 THEN
|
|
|
+ '50'
|
|
|
+ WHEN age >= 60
|
|
|
+ AND age < 70 THEN
|
|
|
+ '60'
|
|
|
+ WHEN age >= 70
|
|
|
+ AND age < 80 THEN
|
|
|
+ '70'
|
|
|
+ WHEN age >= 80
|
|
|
+ AND age < 90 THEN
|
|
|
+ '80'
|
|
|
+ WHEN age > 90 THEN
|
|
|
+ '100以上'
|
|
|
+ END AS age,
|
|
|
+ count(*) AS count
|
|
|
FROM
|
|
|
- t_user_profile
|
|
|
+ t_user_profile
|
|
|
GROUP BY
|
|
|
- CASE
|
|
|
- WHEN age < 20
|
|
|
- THEN
|
|
|
- '10'
|
|
|
- WHEN age >= 20
|
|
|
- AND age < 30 THEN
|
|
|
- '20'
|
|
|
- WHEN age >= 30
|
|
|
- AND age < 40 THEN
|
|
|
- '30'
|
|
|
- WHEN age >= 40
|
|
|
- AND age < 50 THEN
|
|
|
- '40'
|
|
|
- WHEN age >= 50
|
|
|
- AND age < 60 THEN
|
|
|
- '50'
|
|
|
- WHEN age >= 60
|
|
|
- AND age < 70 THEN
|
|
|
- '60'
|
|
|
- WHEN age >= 70
|
|
|
- AND age < 80 THEN
|
|
|
- '70'
|
|
|
- WHEN age >= 80
|
|
|
- AND age < 90 THEN
|
|
|
- '80'
|
|
|
- WHEN age > 90 THEN
|
|
|
- '100以上'
|
|
|
+ CASE
|
|
|
+ WHEN age < 20
|
|
|
+ THEN
|
|
|
+ '10'
|
|
|
+ WHEN age >= 20
|
|
|
+ AND age < 30 THEN
|
|
|
+ '20'
|
|
|
+ WHEN age >= 30
|
|
|
+ AND age < 40 THEN
|
|
|
+ '30'
|
|
|
+ WHEN age >= 40
|
|
|
+ AND age < 50 THEN
|
|
|
+ '40'
|
|
|
+ WHEN age >= 50
|
|
|
+ AND age < 60 THEN
|
|
|
+ '50'
|
|
|
+ WHEN age >= 60
|
|
|
+ AND age < 70 THEN
|
|
|
+ '60'
|
|
|
+ WHEN age >= 70
|
|
|
+ AND age < 80 THEN
|
|
|
+ '70'
|
|
|
+ WHEN age >= 80
|
|
|
+ AND age < 90 THEN
|
|
|
+ '80'
|
|
|
+ WHEN age > 90 THEN
|
|
|
+ '100以上'
|
|
|
END;
|
|
|
</select>
|
|
|
<select id="selectuserAgeCount" resultType="java.lang.Integer">
|
|
|
- select IFNULL(count(*),0) from t_user_profile
|
|
|
+ select IFNULL(count(*), 0)
|
|
|
+ from t_user_profile
|
|
|
</select>
|
|
|
<select id="selectAddUser" resultType="com.ruoyi.system.domain.dto.AddUserDto">
|
|
|
- SELECT DATE_FORMAT(createtime, '%Y-%m') AS month, COUNT(*) AS count FROM t_user_profile GROUP BY month;
|
|
|
+ SELECT DATE_FORMAT(createtime, '%Y-%m') AS month, COUNT(*) AS count
|
|
|
+ FROM t_user_profile
|
|
|
+ GROUP BY month;
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertTUserProfile" parameterType="TUserProfile" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -261,7 +331,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="otherPhoto != null">other_photo,</if>
|
|
|
<if test="remarks != null">remarks,</if>
|
|
|
<if test="createTime != null">createtime,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="name != null">#{name},</if>
|
|
|
<if test="gender != null">#{gender},</if>
|
|
@@ -308,7 +378,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="otherPhoto != null">#{otherPhoto},</if>
|
|
|
<if test="remarks != null">#{remarks},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTUserProfile" parameterType="TUserProfile">
|
|
@@ -364,30 +434,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTUserProfileById" parameterType="Integer">
|
|
|
- delete from t_user_profile where id = #{id}
|
|
|
+ delete
|
|
|
+ from t_user_profile
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTUserProfileByIds" parameterType="String">
|
|
|
- delete from t_user_profile where id in
|
|
|
+ delete from t_user_profile where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
+
|
|
|
<delete id="deleteTEmergentPeopleByProfileIds" parameterType="String">
|
|
|
- delete from t_emergent_people where profile_id in
|
|
|
+ delete from t_emergent_people where profile_id in
|
|
|
<foreach item="profileId" collection="array" open="(" separator="," close=")">
|
|
|
#{profileId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTEmergentPeopleByProfileId" parameterType="Integer">
|
|
|
- delete from t_emergent_people where profile_id = #{profileId}
|
|
|
+ delete
|
|
|
+ from t_emergent_people
|
|
|
+ where profile_id = #{profileId}
|
|
|
</delete>
|
|
|
|
|
|
<insert id="batchTEmergentPeople">
|
|
|
insert into t_emergent_people( id, profile_id, name, telno, relation, is_conn) values
|
|
|
- <foreach item="item" index="index" collection="list" separator=",">
|
|
|
+ <foreach item="item" index="index" collection="list" separator=",">
|
|
|
( #{item.id}, #{item.profileId}, #{item.name}, #{item.telno}, #{item.relation}, #{item.isConn})
|
|
|
</foreach>
|
|
|
</insert>
|