package com.alatus.manager;
import com.alatus.mapper.TActivityMapper;
import com.alatus.mapper.TClueMapper;
import com.alatus.mapper.TCustomerMapper;
import com.alatus.mapper.TTranMapper;
import com.alatus.result.SummaryData;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
@Component
public class StatisticManager {
@Resource
private TActivityMapper tActivityMapper;
@Resource
private TClueMapper tClueMapper;
@Resource
private TCustomerMapper tCustomerMapper;
@Resource
private TTranMapper tTranMapper;
public SummaryData loadSummaryData() {
//有效的市场活动总数
Integer effectiveActivityCount = tActivityMapper.selectOnGoingActivities().size();
//总的市场活动数
Integer totalActivityCount = tActivityMapper.selectActivityCount();
//线索总数
Integer totalClueCount = tClueMapper.selectClueCount();
//客户总数
Integer totalCustomerCount = tCustomerMapper.selectCustomerCount();
//成功的交易额
BigDecimal successTranAmount = tTranMapper.selectTranSuccessAmount();
//总的交易额(包含成功和不成功的)
BigDecimal totalTranAmount = tTranMapper.selectAllTranAmount();
return SummaryData.builder()
.effectiveActivityCount(effectiveActivityCount)
.totalActivityCount(totalActivityCount)
.totalClueCount(totalClueCount)
.totalCustomerCount(totalCustomerCount)
.successTranAmount(successTranAmount)
.totalTranAmount(totalTranAmount)
.build();
}
}
package com.alatus.manager;
import com.alatus.mapper.TActivityMapper;
import com.alatus.mapper.TClueMapper;
import com.alatus.mapper.TCustomerMapper;
import com.alatus.mapper.TTranMapper;
import com.alatus.result.SummaryData;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
@Component
public class StatisticManager {
@Resource
private TActivityMapper tActivityMapper;
@Resource
private TClueMapper tClueMapper;
@Resource
private TCustomerMapper tCustomerMapper;
@Resource
private TTranMapper tTranMapper;
public SummaryData loadSummaryData() {
//有效的市场活动总数
Integer effectiveActivityCount = tActivityMapper.selectOnGoingActivities().size();
//总的市场活动数
Integer totalActivityCount = tActivityMapper.selectActivityCount();
//线索总数
Integer totalClueCount = tClueMapper.selectClueCount();
//客户总数
Integer totalCustomerCount = tCustomerMapper.selectCustomerCount();
//成功的交易额
BigDecimal successTranAmount = tTranMapper.selectTranSuccessAmount();
//总的交易额(包含成功和不成功的)
BigDecimal totalTranAmount = tTranMapper.selectAllTranAmount();
return SummaryData.builder()
.effectiveActivityCount(effectiveActivityCount)
.totalActivityCount(totalActivityCount)
.totalClueCount(totalClueCount)
.totalCustomerCount(totalCustomerCount)
.successTranAmount(successTranAmount)
.totalTranAmount(totalTranAmount)
.build();
}
}
package com.alatus.mapper;
import com.alatus.model.TTran;
import java.math.BigDecimal;
public interface TTranMapper {
int deleteByPrimaryKey(Integer id);
int insert(TTran record);
int insertSelective(TTran record);
TTran selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TTran record);
int updateByPrimaryKey(TTran record);
BigDecimal selectTranSuccessAmount();
BigDecimal selectAllTranAmount();
}
package com.alatus.mapper;
import com.alatus.model.TTran;
import java.math.BigDecimal;
public interface TTranMapper {
int deleteByPrimaryKey(Integer id);
int insert(TTran record);
int insertSelective(TTran record);
TTran selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TTran record);
int updateByPrimaryKey(TTran record);
BigDecimal selectTranSuccessAmount();
BigDecimal selectAllTranAmount();
}
<?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.alatus.mapper.TTranMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TTran">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="tran_no" jdbcType="VARCHAR" property="tranNo" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="money" jdbcType="DECIMAL" property="money" />
<result column="expected_date" jdbcType="TIMESTAMP" property="expectedDate" />
<result column="stage" jdbcType="INTEGER" property="stage" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<sql id="Base_Column_List">
id, tran_no, customer_id, money, expected_date, stage, description, next_contact_time,
create_time, create_by, edit_time, edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_tran
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAllTranAmount" resultType="java.math.BigDecimal">
select
sum(money)
from t_tran
</select>
<select id="selectTranSuccessAmount" resultType="java.math.BigDecimal">
select
sum(money)
from t_tran
where stage = 42
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_tran
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TTran" useGeneratedKeys="true">
insert into t_tran (tran_no, customer_id, money,
expected_date, stage, description,
next_contact_time, create_time, create_by,
edit_time, edit_by)
values (#{tranNo,jdbcType=VARCHAR}, #{customerId,jdbcType=INTEGER}, #{money,jdbcType=DECIMAL},
#{expectedDate,jdbcType=TIMESTAMP}, #{stage,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR},
#{nextContactTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TTran" useGeneratedKeys="true">
insert into t_tran
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tranNo != null">
tran_no,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="money != null">
money,
</if>
<if test="expectedDate != null">
expected_date,
</if>
<if test="stage != null">
stage,
</if>
<if test="description != null">
description,
</if>
<if test="nextContactTime != null">
next_contact_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tranNo != null">
#{tranNo,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="money != null">
#{money,jdbcType=DECIMAL},
</if>
<if test="expectedDate != null">
#{expectedDate,jdbcType=TIMESTAMP},
</if>
<if test="stage != null">
#{stage,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
#{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TTran">
update t_tran
<set>
<if test="tranNo != null">
tran_no = #{tranNo,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="money != null">
money = #{money,jdbcType=DECIMAL},
</if>
<if test="expectedDate != null">
expected_date = #{expectedDate,jdbcType=TIMESTAMP},
</if>
<if test="stage != null">
stage = #{stage,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TTran">
update t_tran
set tran_no = #{tranNo,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=INTEGER},
money = #{money,jdbcType=DECIMAL},
expected_date = #{expectedDate,jdbcType=TIMESTAMP},
stage = #{stage,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
<?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.alatus.mapper.TTranMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TTran">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="tran_no" jdbcType="VARCHAR" property="tranNo" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="money" jdbcType="DECIMAL" property="money" />
<result column="expected_date" jdbcType="TIMESTAMP" property="expectedDate" />
<result column="stage" jdbcType="INTEGER" property="stage" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<sql id="Base_Column_List">
id, tran_no, customer_id, money, expected_date, stage, description, next_contact_time,
create_time, create_by, edit_time, edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_tran
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAllTranAmount" resultType="java.math.BigDecimal">
select
sum(money)
from t_tran
</select>
<select id="selectTranSuccessAmount" resultType="java.math.BigDecimal">
select
sum(money)
from t_tran
where stage = 42
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_tran
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TTran" useGeneratedKeys="true">
insert into t_tran (tran_no, customer_id, money,
expected_date, stage, description,
next_contact_time, create_time, create_by,
edit_time, edit_by)
values (#{tranNo,jdbcType=VARCHAR}, #{customerId,jdbcType=INTEGER}, #{money,jdbcType=DECIMAL},
#{expectedDate,jdbcType=TIMESTAMP}, #{stage,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR},
#{nextContactTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TTran" useGeneratedKeys="true">
insert into t_tran
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tranNo != null">
tran_no,
</if>
<if test="customerId != null">
customer_id,
</if>
<if test="money != null">
money,
</if>
<if test="expectedDate != null">
expected_date,
</if>
<if test="stage != null">
stage,
</if>
<if test="description != null">
description,
</if>
<if test="nextContactTime != null">
next_contact_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tranNo != null">
#{tranNo,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
#{customerId,jdbcType=INTEGER},
</if>
<if test="money != null">
#{money,jdbcType=DECIMAL},
</if>
<if test="expectedDate != null">
#{expectedDate,jdbcType=TIMESTAMP},
</if>
<if test="stage != null">
#{stage,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
#{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TTran">
update t_tran
<set>
<if test="tranNo != null">
tran_no = #{tranNo,jdbcType=VARCHAR},
</if>
<if test="customerId != null">
customer_id = #{customerId,jdbcType=INTEGER},
</if>
<if test="money != null">
money = #{money,jdbcType=DECIMAL},
</if>
<if test="expectedDate != null">
expected_date = #{expectedDate,jdbcType=TIMESTAMP},
</if>
<if test="stage != null">
stage = #{stage,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TTran">
update t_tran
set tran_no = #{tranNo,jdbcType=VARCHAR},
customer_id = #{customerId,jdbcType=INTEGER},
money = #{money,jdbcType=DECIMAL},
expected_date = #{expectedDate,jdbcType=TIMESTAMP},
stage = #{stage,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
package com.alatus.mapper;
import com.alatus.model.TCustomer;
import java.util.ArrayList;
import java.util.List;
public interface TCustomerMapper {
int deleteByPrimaryKey(Integer id);
int insert(TCustomer record);
int insertSelective(TCustomer record);
TCustomer selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TCustomer record);
int updateByPrimaryKey(TCustomer record);
ArrayList<TCustomer> selectCustomerByPage();
List<TCustomer> selectCustomerByExcel(List<String> idList);
Integer selectCustomerCount();
}
package com.alatus.mapper;
import com.alatus.model.TCustomer;
import java.util.ArrayList;
import java.util.List;
public interface TCustomerMapper {
int deleteByPrimaryKey(Integer id);
int insert(TCustomer record);
int insertSelective(TCustomer record);
TCustomer selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TCustomer record);
int updateByPrimaryKey(TCustomer record);
ArrayList<TCustomer> selectCustomerByPage();
List<TCustomer> selectCustomerByExcel(List<String> idList);
Integer selectCustomerCount();
}
<?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.alatus.mapper.TCustomerMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TCustomer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="clue_id" jdbcType="INTEGER" property="clueId" />
<result column="product" jdbcType="INTEGER" property="product" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<resultMap id="CustomerResultMap" type="com.alatus.model.TCustomer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="clue_id" jdbcType="INTEGER" property="clueId" />
<result column="product" jdbcType="INTEGER" property="product" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<!--一对一关联线索-->
<association property="clueDO" javaType="com.alatus.model.TClue">
<id column="clueId" jdbcType="INTEGER" property="id" />
<result column="full_name" jdbcType="VARCHAR" property="fullName" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="weixin" jdbcType="VARCHAR" property="weixin" />
<result column="qq" jdbcType="VARCHAR" property="qq" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="job" jdbcType="VARCHAR" property="job" />
<result column="year_income" jdbcType="DECIMAL" property="yearIncome" />
<result column="address" jdbcType="VARCHAR" property="address" />
</association>
<!--一对一关联查询的映射-->
<association property="ownerDO" javaType="com.alatus.model.TUser">
<id column="ownerId" jdbcType="INTEGER" property="id" />
<result column="ownerName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="activityDO" javaType="com.alatus.model.TActivity">
<id column="activityId" jdbcType="INTEGER" property="id" />
<result column="activityName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="appellationDO" javaType="com.alatus.model.TDicValue">
<id column="appellationId" jdbcType="INTEGER" property="id" />
<result column="appellationName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="needLoanDO" javaType="com.alatus.model.TDicValue">
<id column="needLoanId" jdbcType="INTEGER" property="id" />
<result column="needLoanName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionStateDO" javaType="com.alatus.model.TDicValue">
<id column="intentionStateId" jdbcType="INTEGER" property="id" />
<result column="intentionStateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="stateDO" javaType="com.alatus.model.TDicValue">
<id column="stateId" jdbcType="INTEGER" property="id" />
<result column="stateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="sourceDO" javaType="com.alatus.model.TDicValue">
<id column="sourceId" jdbcType="INTEGER" property="id" />
<result column="sourceName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionProductDO" javaType="com.alatus.model.TProduct">
<id column="intentionProductId" jdbcType="INTEGER" property="id" />
<result column="intentionProductName" jdbcType="VARCHAR" property="name" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, clue_id, product, description, next_contact_time, create_time, create_by, edit_time,
edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_customer
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectCustomerByPage" parameterType="java.lang.Integer" resultMap="CustomerResultMap">
select
tct.*,
tc.id clueId, tc.full_name, tc.phone, tc.weixin,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName,
tp.id intentionProductId, tp.name intentionProductName
from t_customer tct left join t_clue tc on tct.clue_id = tc.id
left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
left join t_product tp on tct.product = tp.id
</select>
<select id="selectCustomerByExcel" parameterType="java.util.List" resultMap="CustomerResultMap">
select
tct.*,
tc.id clueId, tc.full_name, tc.phone, tc.weixin,tc.qq,tc.email,tc.age,tc.job,tc.address,tc.year_income,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName,
tp.id intentionProductId, tp.name intentionProductName
from t_customer tct left join t_clue tc on tct.clue_id = tc.id
left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
left join t_product tp on tct.product = tp.id
<where>
<if test="idList != null and idList.size() > 0">
and tct.id in
<foreach collection="idList" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectCustomerCount" resultType="java.lang.Integer">
select count(0)
from t_customer
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_customer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TCustomer" useGeneratedKeys="true">
insert into t_customer (clue_id, product, description,
next_contact_time, create_time, create_by,
edit_time, edit_by)
values (#{clueId,jdbcType=INTEGER}, #{product,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR},
#{nextContactTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TCustomer" useGeneratedKeys="true">
insert into t_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clueId != null">
clue_id,
</if>
<if test="product != null">
product,
</if>
<if test="description != null">
description,
</if>
<if test="nextContactTime != null">
next_contact_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clueId != null">
#{clueId,jdbcType=INTEGER},
</if>
<if test="product != null">
#{product,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
#{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TCustomer">
update t_customer
<set>
<if test="clueId != null">
clue_id = #{clueId,jdbcType=INTEGER},
</if>
<if test="product != null">
product = #{product,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TCustomer">
update t_customer
set clue_id = #{clueId,jdbcType=INTEGER},
product = #{product,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
<?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.alatus.mapper.TCustomerMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TCustomer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="clue_id" jdbcType="INTEGER" property="clueId" />
<result column="product" jdbcType="INTEGER" property="product" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<resultMap id="CustomerResultMap" type="com.alatus.model.TCustomer">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="clue_id" jdbcType="INTEGER" property="clueId" />
<result column="product" jdbcType="INTEGER" property="product" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<!--一对一关联线索-->
<association property="clueDO" javaType="com.alatus.model.TClue">
<id column="clueId" jdbcType="INTEGER" property="id" />
<result column="full_name" jdbcType="VARCHAR" property="fullName" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="weixin" jdbcType="VARCHAR" property="weixin" />
<result column="qq" jdbcType="VARCHAR" property="qq" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="job" jdbcType="VARCHAR" property="job" />
<result column="year_income" jdbcType="DECIMAL" property="yearIncome" />
<result column="address" jdbcType="VARCHAR" property="address" />
</association>
<!--一对一关联查询的映射-->
<association property="ownerDO" javaType="com.alatus.model.TUser">
<id column="ownerId" jdbcType="INTEGER" property="id" />
<result column="ownerName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="activityDO" javaType="com.alatus.model.TActivity">
<id column="activityId" jdbcType="INTEGER" property="id" />
<result column="activityName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="appellationDO" javaType="com.alatus.model.TDicValue">
<id column="appellationId" jdbcType="INTEGER" property="id" />
<result column="appellationName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="needLoanDO" javaType="com.alatus.model.TDicValue">
<id column="needLoanId" jdbcType="INTEGER" property="id" />
<result column="needLoanName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionStateDO" javaType="com.alatus.model.TDicValue">
<id column="intentionStateId" jdbcType="INTEGER" property="id" />
<result column="intentionStateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="stateDO" javaType="com.alatus.model.TDicValue">
<id column="stateId" jdbcType="INTEGER" property="id" />
<result column="stateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="sourceDO" javaType="com.alatus.model.TDicValue">
<id column="sourceId" jdbcType="INTEGER" property="id" />
<result column="sourceName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionProductDO" javaType="com.alatus.model.TProduct">
<id column="intentionProductId" jdbcType="INTEGER" property="id" />
<result column="intentionProductName" jdbcType="VARCHAR" property="name" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, clue_id, product, description, next_contact_time, create_time, create_by, edit_time,
edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_customer
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectCustomerByPage" parameterType="java.lang.Integer" resultMap="CustomerResultMap">
select
tct.*,
tc.id clueId, tc.full_name, tc.phone, tc.weixin,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName,
tp.id intentionProductId, tp.name intentionProductName
from t_customer tct left join t_clue tc on tct.clue_id = tc.id
left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
left join t_product tp on tct.product = tp.id
</select>
<select id="selectCustomerByExcel" parameterType="java.util.List" resultMap="CustomerResultMap">
select
tct.*,
tc.id clueId, tc.full_name, tc.phone, tc.weixin,tc.qq,tc.email,tc.age,tc.job,tc.address,tc.year_income,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName,
tp.id intentionProductId, tp.name intentionProductName
from t_customer tct left join t_clue tc on tct.clue_id = tc.id
left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
left join t_product tp on tct.product = tp.id
<where>
<if test="idList != null and idList.size() > 0">
and tct.id in
<foreach collection="idList" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectCustomerCount" resultType="java.lang.Integer">
select count(0)
from t_customer
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_customer
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TCustomer" useGeneratedKeys="true">
insert into t_customer (clue_id, product, description,
next_contact_time, create_time, create_by,
edit_time, edit_by)
values (#{clueId,jdbcType=INTEGER}, #{product,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR},
#{nextContactTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP}, #{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TCustomer" useGeneratedKeys="true">
insert into t_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clueId != null">
clue_id,
</if>
<if test="product != null">
product,
</if>
<if test="description != null">
description,
</if>
<if test="nextContactTime != null">
next_contact_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clueId != null">
#{clueId,jdbcType=INTEGER},
</if>
<if test="product != null">
#{product,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
#{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TCustomer">
update t_customer
<set>
<if test="clueId != null">
clue_id = #{clueId,jdbcType=INTEGER},
</if>
<if test="product != null">
product = #{product,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TCustomer">
update t_customer
set clue_id = #{clueId,jdbcType=INTEGER},
product = #{product,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
package com.alatus.mapper;
import com.alatus.model.TClue;
import com.alatus.query.BaseQuery;
import java.util.List;
public interface TClueMapper {
int deleteByPrimaryKey(Integer id);
int insert(TClue record);
int insertSelective(TClue record);
TClue selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TClue record);
int updateByPrimaryKey(TClue record);
List<TClue> selectClueByPage(BaseQuery build);
void saveClue(List<TClue> tClueList);
int deleteByIds(List<String> idsList);
int selectByCount(String phone);
TClue selectDetailByPrimaryKey(Integer id);
Integer selectClueCount();
}
package com.alatus.mapper;
import com.alatus.model.TClue;
import com.alatus.query.BaseQuery;
import java.util.List;
public interface TClueMapper {
int deleteByPrimaryKey(Integer id);
int insert(TClue record);
int insertSelective(TClue record);
TClue selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TClue record);
int updateByPrimaryKey(TClue record);
List<TClue> selectClueByPage(BaseQuery build);
void saveClue(List<TClue> tClueList);
int deleteByIds(List<String> idsList);
int selectByCount(String phone);
TClue selectDetailByPrimaryKey(Integer id);
Integer selectClueCount();
}
<?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.alatus.mapper.TClueMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TClue">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="full_name" jdbcType="VARCHAR" property="fullName" />
<result column="appellation" jdbcType="INTEGER" property="appellation" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="weixin" jdbcType="VARCHAR" property="weixin" />
<result column="qq" jdbcType="VARCHAR" property="qq" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="job" jdbcType="VARCHAR" property="job" />
<result column="year_income" jdbcType="DECIMAL" property="yearIncome" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="need_loan" jdbcType="INTEGER" property="needLoan" />
<result column="intention_state" jdbcType="INTEGER" property="intentionState" />
<result column="intention_product" jdbcType="INTEGER" property="intentionProduct" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="source" jdbcType="INTEGER" property="source" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<resultMap id="ClueResultMap" type="com.alatus.model.TClue">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="full_name" jdbcType="VARCHAR" property="fullName" />
<result column="appellation" jdbcType="INTEGER" property="appellation" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="weixin" jdbcType="VARCHAR" property="weixin" />
<result column="qq" jdbcType="VARCHAR" property="qq" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="job" jdbcType="VARCHAR" property="job" />
<result column="year_income" jdbcType="DECIMAL" property="yearIncome" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="need_loan" jdbcType="INTEGER" property="needLoan" />
<result column="intention_state" jdbcType="INTEGER" property="intentionState" />
<result column="intention_product" jdbcType="INTEGER" property="intentionProduct" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="source" jdbcType="INTEGER" property="source" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<!--一对一关联查询的映射-->
<association property="ownerDO" javaType="com.alatus.model.TUser">
<id column="ownerId" jdbcType="INTEGER" property="id" />
<result column="ownerName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="activityDO" javaType="com.alatus.model.TActivity">
<id column="activityId" jdbcType="INTEGER" property="id" />
<result column="activityName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="appellationDO" javaType="com.alatus.model.TDicValue">
<id column="appellationId" jdbcType="INTEGER" property="id" />
<result column="appellationName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="needLoanDO" javaType="com.alatus.model.TDicValue">
<id column="needLoanId" jdbcType="INTEGER" property="id" />
<result column="needLoanName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionStateDO" javaType="com.alatus.model.TDicValue">
<id column="intentionStateId" jdbcType="INTEGER" property="id" />
<result column="intentionStateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionProductDO" javaType="com.alatus.model.TProduct">
<id column="intentionProductId" jdbcType="INTEGER" property="id" />
<result column="intentionProductName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="stateDO" javaType="com.alatus.model.TDicValue">
<id column="stateId" jdbcType="INTEGER" property="id" />
<result column="stateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="sourceDO" javaType="com.alatus.model.TDicValue">
<id column="sourceId" jdbcType="INTEGER" property="id" />
<result column="sourceName" jdbcType="VARCHAR" property="typeValue" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, owner_id, activity_id, full_name, appellation, phone, weixin, qq, email, age,
job, year_income, address, need_loan, intention_state, intention_product, `state`,
`source`, description, next_contact_time, create_time, create_by, edit_time, edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_clue
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectClueByPage" parameterType="java.lang.Integer" resultMap="ClueResultMap">
select
tc.*,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tp.id intentionProductId, tp.name intentionProductName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName
from t_clue tc left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_product tp on tc.intention_product = tp.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
</select>
<select id="selectByCount" parameterType="java.lang.String" resultType="java.lang.Integer">
select
count(0)
from t_clue
where phone = #{phone,jdbcType=VARCHAR}
</select>
<select id="selectDetailByPrimaryKey" parameterType="java.lang.Integer" resultMap="ClueResultMap">
select
tc.*,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tp.id intentionProductId, tp.name intentionProductName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName
from t_clue tc left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_product tp on tc.intention_product = tp.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
where tc.id = #{id,jdbcType=INTEGER}
</select>
<select id="selectClueCount" resultType="java.lang.Integer">
select count(0)
from t_clue
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_clue
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByIds" parameterType="java.util.List">
delete from t_clue
where id in
<foreach collection="idsList" item="id" open="(" close=")" separator=",">
#{id,jdbcType=INTEGER}
</foreach>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TClue" useGeneratedKeys="true">
insert into t_clue (owner_id, activity_id, full_name,
appellation, phone, weixin,
qq, email, age, job,
year_income, address, need_loan,
intention_state, intention_product, `state`,
`source`, description, next_contact_time,
create_time, create_by, edit_time,
edit_by)
values (#{ownerId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{fullName,jdbcType=VARCHAR},
#{appellation,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{weixin,jdbcType=VARCHAR},
#{qq,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{job,jdbcType=VARCHAR},
#{yearIncome,jdbcType=DECIMAL}, #{address,jdbcType=VARCHAR}, #{needLoan,jdbcType=INTEGER},
#{intentionState,jdbcType=INTEGER}, #{intentionProduct,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{source,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{nextContactTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP},
#{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TClue" useGeneratedKeys="true">
insert into t_clue
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
owner_id,
</if>
<if test="activityId != null">
activity_id,
</if>
<if test="fullName != null">
full_name,
</if>
<if test="appellation != null">
appellation,
</if>
<if test="phone != null">
phone,
</if>
<if test="weixin != null">
weixin,
</if>
<if test="qq != null">
qq,
</if>
<if test="email != null">
email,
</if>
<if test="age != null">
age,
</if>
<if test="job != null">
job,
</if>
<if test="yearIncome != null">
year_income,
</if>
<if test="address != null">
address,
</if>
<if test="needLoan != null">
need_loan,
</if>
<if test="intentionState != null">
intention_state,
</if>
<if test="intentionProduct != null">
intention_product,
</if>
<if test="state != null">
`state`,
</if>
<if test="source != null">
`source`,
</if>
<if test="description != null">
description,
</if>
<if test="nextContactTime != null">
next_contact_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
#{ownerId,jdbcType=INTEGER},
</if>
<if test="activityId != null">
#{activityId,jdbcType=INTEGER},
</if>
<if test="fullName != null">
#{fullName,jdbcType=VARCHAR},
</if>
<if test="appellation != null">
#{appellation,jdbcType=INTEGER},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="weixin != null">
#{weixin,jdbcType=VARCHAR},
</if>
<if test="qq != null">
#{qq,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="age != null">
#{age,jdbcType=INTEGER},
</if>
<if test="job != null">
#{job,jdbcType=VARCHAR},
</if>
<if test="yearIncome != null">
#{yearIncome,jdbcType=DECIMAL},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="needLoan != null">
#{needLoan,jdbcType=INTEGER},
</if>
<if test="intentionState != null">
#{intentionState,jdbcType=INTEGER},
</if>
<if test="intentionProduct != null">
#{intentionProduct,jdbcType=INTEGER},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="source != null">
#{source,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
#{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<!--批量保存-->
<insert id="saveClue" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TClue" useGeneratedKeys="true">
insert into t_clue(`owner_id`, `activity_id`, `full_name`,
`appellation`, `phone`, `weixin`,
`qq`, `email`, `age`, `job`,
`year_income`, `address`, `need_loan`,
`intention_state`, `intention_product`, `state`,
`source`, `description`, `next_contact_time`,
`create_time`, `create_by`, `edit_time`,
edit_by)
values
<foreach collection="tClueList" item="tClue" separator="," >
(#{tClue.ownerId,jdbcType=INTEGER}, #{tClue.activityId,jdbcType=INTEGER}, #{tClue.fullName,jdbcType=VARCHAR},
#{tClue.appellation,jdbcType=INTEGER}, #{tClue.phone,jdbcType=VARCHAR}, #{tClue.weixin,jdbcType=VARCHAR},
#{tClue.qq,jdbcType=VARCHAR}, #{tClue.email,jdbcType=VARCHAR}, #{tClue.age,jdbcType=INTEGER}, #{tClue.job,jdbcType=VARCHAR},
#{tClue.yearIncome,jdbcType=DECIMAL}, #{tClue.address,jdbcType=VARCHAR}, #{tClue.needLoan,jdbcType=INTEGER},
#{tClue.intentionState,jdbcType=INTEGER}, #{tClue.intentionProduct,jdbcType=INTEGER}, #{tClue.state,jdbcType=INTEGER},
#{tClue.source,jdbcType=INTEGER}, #{tClue.description,jdbcType=VARCHAR}, #{tClue.nextContactTime,jdbcType=TIMESTAMP},
#{tClue.createTime,jdbcType=TIMESTAMP}, #{tClue.createBy,jdbcType=INTEGER}, #{tClue.editTime,jdbcType=TIMESTAMP},
#{tClue.editBy,jdbcType=INTEGER})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TClue">
update t_clue
<set>
<if test="ownerId != null">
owner_id = #{ownerId,jdbcType=INTEGER},
</if>
<if test="activityId != null">
activity_id = #{activityId,jdbcType=INTEGER},
</if>
<if test="fullName != null">
full_name = #{fullName,jdbcType=VARCHAR},
</if>
<if test="appellation != null">
appellation = #{appellation,jdbcType=INTEGER},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="weixin != null">
weixin = #{weixin,jdbcType=VARCHAR},
</if>
<if test="qq != null">
qq = #{qq,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="age != null">
age = #{age,jdbcType=INTEGER},
</if>
<if test="job != null">
job = #{job,jdbcType=VARCHAR},
</if>
<if test="yearIncome != null">
year_income = #{yearIncome,jdbcType=DECIMAL},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="needLoan != null">
need_loan = #{needLoan,jdbcType=INTEGER},
</if>
<if test="intentionState != null">
intention_state = #{intentionState,jdbcType=INTEGER},
</if>
<if test="intentionProduct != null">
intention_product = #{intentionProduct,jdbcType=INTEGER},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
<if test="source != null">
`source` = #{source,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TClue">
update t_clue
set owner_id = #{ownerId,jdbcType=INTEGER},
activity_id = #{activityId,jdbcType=INTEGER},
full_name = #{fullName,jdbcType=VARCHAR},
appellation = #{appellation,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
weixin = #{weixin,jdbcType=VARCHAR},
qq = #{qq,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER},
job = #{job,jdbcType=VARCHAR},
year_income = #{yearIncome,jdbcType=DECIMAL},
address = #{address,jdbcType=VARCHAR},
need_loan = #{needLoan,jdbcType=INTEGER},
intention_state = #{intentionState,jdbcType=INTEGER},
intention_product = #{intentionProduct,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER},
`source` = #{source,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
<?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.alatus.mapper.TClueMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TClue">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="full_name" jdbcType="VARCHAR" property="fullName" />
<result column="appellation" jdbcType="INTEGER" property="appellation" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="weixin" jdbcType="VARCHAR" property="weixin" />
<result column="qq" jdbcType="VARCHAR" property="qq" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="job" jdbcType="VARCHAR" property="job" />
<result column="year_income" jdbcType="DECIMAL" property="yearIncome" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="need_loan" jdbcType="INTEGER" property="needLoan" />
<result column="intention_state" jdbcType="INTEGER" property="intentionState" />
<result column="intention_product" jdbcType="INTEGER" property="intentionProduct" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="source" jdbcType="INTEGER" property="source" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<resultMap id="ClueResultMap" type="com.alatus.model.TClue">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="activity_id" jdbcType="INTEGER" property="activityId" />
<result column="full_name" jdbcType="VARCHAR" property="fullName" />
<result column="appellation" jdbcType="INTEGER" property="appellation" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="weixin" jdbcType="VARCHAR" property="weixin" />
<result column="qq" jdbcType="VARCHAR" property="qq" />
<result column="email" jdbcType="VARCHAR" property="email" />
<result column="age" jdbcType="INTEGER" property="age" />
<result column="job" jdbcType="VARCHAR" property="job" />
<result column="year_income" jdbcType="DECIMAL" property="yearIncome" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="need_loan" jdbcType="INTEGER" property="needLoan" />
<result column="intention_state" jdbcType="INTEGER" property="intentionState" />
<result column="intention_product" jdbcType="INTEGER" property="intentionProduct" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="source" jdbcType="INTEGER" property="source" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="next_contact_time" jdbcType="TIMESTAMP" property="nextContactTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<!--一对一关联查询的映射-->
<association property="ownerDO" javaType="com.alatus.model.TUser">
<id column="ownerId" jdbcType="INTEGER" property="id" />
<result column="ownerName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="activityDO" javaType="com.alatus.model.TActivity">
<id column="activityId" jdbcType="INTEGER" property="id" />
<result column="activityName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="appellationDO" javaType="com.alatus.model.TDicValue">
<id column="appellationId" jdbcType="INTEGER" property="id" />
<result column="appellationName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="needLoanDO" javaType="com.alatus.model.TDicValue">
<id column="needLoanId" jdbcType="INTEGER" property="id" />
<result column="needLoanName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionStateDO" javaType="com.alatus.model.TDicValue">
<id column="intentionStateId" jdbcType="INTEGER" property="id" />
<result column="intentionStateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="intentionProductDO" javaType="com.alatus.model.TProduct">
<id column="intentionProductId" jdbcType="INTEGER" property="id" />
<result column="intentionProductName" jdbcType="VARCHAR" property="name" />
</association>
<!--一对一关联查询的映射-->
<association property="stateDO" javaType="com.alatus.model.TDicValue">
<id column="stateId" jdbcType="INTEGER" property="id" />
<result column="stateName" jdbcType="VARCHAR" property="typeValue" />
</association>
<!--一对一关联查询的映射-->
<association property="sourceDO" javaType="com.alatus.model.TDicValue">
<id column="sourceId" jdbcType="INTEGER" property="id" />
<result column="sourceName" jdbcType="VARCHAR" property="typeValue" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, owner_id, activity_id, full_name, appellation, phone, weixin, qq, email, age,
job, year_income, address, need_loan, intention_state, intention_product, `state`,
`source`, description, next_contact_time, create_time, create_by, edit_time, edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_clue
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectClueByPage" parameterType="java.lang.Integer" resultMap="ClueResultMap">
select
tc.*,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tp.id intentionProductId, tp.name intentionProductName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName
from t_clue tc left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_product tp on tc.intention_product = tp.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
</select>
<select id="selectByCount" parameterType="java.lang.String" resultType="java.lang.Integer">
select
count(0)
from t_clue
where phone = #{phone,jdbcType=VARCHAR}
</select>
<select id="selectDetailByPrimaryKey" parameterType="java.lang.Integer" resultMap="ClueResultMap">
select
tc.*,
tu1.id ownerId, tu1.name ownerName,
ta.id activityId, ta.name activityName,
tdv.id appellationId, tdv.type_value appellationName,
tdv2.id needLoanId, tdv2.type_value needLoanName,
tdv3.id intentionStateId, tdv3.type_value intentionStateName,
tp.id intentionProductId, tp.name intentionProductName,
tdv4.id stateId, tdv4.type_value stateName,
tdv5.id sourceId, tdv5.type_value sourceName
from t_clue tc left join t_user tu1 on tc.owner_id = tu1.id
left join t_activity ta on tc.activity_id = ta.id
left join t_dic_value tdv on tc.appellation = tdv.id
left join t_dic_value tdv2 on tc.need_loan = tdv2.id
left join t_dic_value tdv3 on tc.intention_state = tdv3.id
left join t_product tp on tc.intention_product = tp.id
left join t_dic_value tdv4 on tc.state = tdv4.id
left join t_dic_value tdv5 on tc.source = tdv5.id
where tc.id = #{id,jdbcType=INTEGER}
</select>
<select id="selectClueCount" resultType="java.lang.Integer">
select count(0)
from t_clue
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_clue
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByIds" parameterType="java.util.List">
delete from t_clue
where id in
<foreach collection="idsList" item="id" open="(" close=")" separator=",">
#{id,jdbcType=INTEGER}
</foreach>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TClue" useGeneratedKeys="true">
insert into t_clue (owner_id, activity_id, full_name,
appellation, phone, weixin,
qq, email, age, job,
year_income, address, need_loan,
intention_state, intention_product, `state`,
`source`, description, next_contact_time,
create_time, create_by, edit_time,
edit_by)
values (#{ownerId,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{fullName,jdbcType=VARCHAR},
#{appellation,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{weixin,jdbcType=VARCHAR},
#{qq,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{job,jdbcType=VARCHAR},
#{yearIncome,jdbcType=DECIMAL}, #{address,jdbcType=VARCHAR}, #{needLoan,jdbcType=INTEGER},
#{intentionState,jdbcType=INTEGER}, #{intentionProduct,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
#{source,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{nextContactTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP},
#{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TClue" useGeneratedKeys="true">
insert into t_clue
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
owner_id,
</if>
<if test="activityId != null">
activity_id,
</if>
<if test="fullName != null">
full_name,
</if>
<if test="appellation != null">
appellation,
</if>
<if test="phone != null">
phone,
</if>
<if test="weixin != null">
weixin,
</if>
<if test="qq != null">
qq,
</if>
<if test="email != null">
email,
</if>
<if test="age != null">
age,
</if>
<if test="job != null">
job,
</if>
<if test="yearIncome != null">
year_income,
</if>
<if test="address != null">
address,
</if>
<if test="needLoan != null">
need_loan,
</if>
<if test="intentionState != null">
intention_state,
</if>
<if test="intentionProduct != null">
intention_product,
</if>
<if test="state != null">
`state`,
</if>
<if test="source != null">
`source`,
</if>
<if test="description != null">
description,
</if>
<if test="nextContactTime != null">
next_contact_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
#{ownerId,jdbcType=INTEGER},
</if>
<if test="activityId != null">
#{activityId,jdbcType=INTEGER},
</if>
<if test="fullName != null">
#{fullName,jdbcType=VARCHAR},
</if>
<if test="appellation != null">
#{appellation,jdbcType=INTEGER},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="weixin != null">
#{weixin,jdbcType=VARCHAR},
</if>
<if test="qq != null">
#{qq,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="age != null">
#{age,jdbcType=INTEGER},
</if>
<if test="job != null">
#{job,jdbcType=VARCHAR},
</if>
<if test="yearIncome != null">
#{yearIncome,jdbcType=DECIMAL},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="needLoan != null">
#{needLoan,jdbcType=INTEGER},
</if>
<if test="intentionState != null">
#{intentionState,jdbcType=INTEGER},
</if>
<if test="intentionProduct != null">
#{intentionProduct,jdbcType=INTEGER},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="source != null">
#{source,jdbcType=INTEGER},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
#{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<!--批量保存-->
<insert id="saveClue" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TClue" useGeneratedKeys="true">
insert into t_clue(`owner_id`, `activity_id`, `full_name`,
`appellation`, `phone`, `weixin`,
`qq`, `email`, `age`, `job`,
`year_income`, `address`, `need_loan`,
`intention_state`, `intention_product`, `state`,
`source`, `description`, `next_contact_time`,
`create_time`, `create_by`, `edit_time`,
edit_by)
values
<foreach collection="tClueList" item="tClue" separator="," >
(#{tClue.ownerId,jdbcType=INTEGER}, #{tClue.activityId,jdbcType=INTEGER}, #{tClue.fullName,jdbcType=VARCHAR},
#{tClue.appellation,jdbcType=INTEGER}, #{tClue.phone,jdbcType=VARCHAR}, #{tClue.weixin,jdbcType=VARCHAR},
#{tClue.qq,jdbcType=VARCHAR}, #{tClue.email,jdbcType=VARCHAR}, #{tClue.age,jdbcType=INTEGER}, #{tClue.job,jdbcType=VARCHAR},
#{tClue.yearIncome,jdbcType=DECIMAL}, #{tClue.address,jdbcType=VARCHAR}, #{tClue.needLoan,jdbcType=INTEGER},
#{tClue.intentionState,jdbcType=INTEGER}, #{tClue.intentionProduct,jdbcType=INTEGER}, #{tClue.state,jdbcType=INTEGER},
#{tClue.source,jdbcType=INTEGER}, #{tClue.description,jdbcType=VARCHAR}, #{tClue.nextContactTime,jdbcType=TIMESTAMP},
#{tClue.createTime,jdbcType=TIMESTAMP}, #{tClue.createBy,jdbcType=INTEGER}, #{tClue.editTime,jdbcType=TIMESTAMP},
#{tClue.editBy,jdbcType=INTEGER})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TClue">
update t_clue
<set>
<if test="ownerId != null">
owner_id = #{ownerId,jdbcType=INTEGER},
</if>
<if test="activityId != null">
activity_id = #{activityId,jdbcType=INTEGER},
</if>
<if test="fullName != null">
full_name = #{fullName,jdbcType=VARCHAR},
</if>
<if test="appellation != null">
appellation = #{appellation,jdbcType=INTEGER},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="weixin != null">
weixin = #{weixin,jdbcType=VARCHAR},
</if>
<if test="qq != null">
qq = #{qq,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="age != null">
age = #{age,jdbcType=INTEGER},
</if>
<if test="job != null">
job = #{job,jdbcType=VARCHAR},
</if>
<if test="yearIncome != null">
year_income = #{yearIncome,jdbcType=DECIMAL},
</if>
<if test="address != null">
address = #{address,jdbcType=VARCHAR},
</if>
<if test="needLoan != null">
need_loan = #{needLoan,jdbcType=INTEGER},
</if>
<if test="intentionState != null">
intention_state = #{intentionState,jdbcType=INTEGER},
</if>
<if test="intentionProduct != null">
intention_product = #{intentionProduct,jdbcType=INTEGER},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
<if test="source != null">
`source` = #{source,jdbcType=INTEGER},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="nextContactTime != null">
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TClue">
update t_clue
set owner_id = #{ownerId,jdbcType=INTEGER},
activity_id = #{activityId,jdbcType=INTEGER},
full_name = #{fullName,jdbcType=VARCHAR},
appellation = #{appellation,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
weixin = #{weixin,jdbcType=VARCHAR},
qq = #{qq,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER},
job = #{job,jdbcType=VARCHAR},
year_income = #{yearIncome,jdbcType=DECIMAL},
address = #{address,jdbcType=VARCHAR},
need_loan = #{needLoan,jdbcType=INTEGER},
intention_state = #{intentionState,jdbcType=INTEGER},
intention_product = #{intentionProduct,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER},
`source` = #{source,jdbcType=INTEGER},
description = #{description,jdbcType=VARCHAR},
next_contact_time = #{nextContactTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
package com.alatus.mapper;
import com.alatus.commons.DataScope;
import com.alatus.model.TActivity;
import com.alatus.query.ActivityQuery;
import java.util.ArrayList;
import java.util.List;
public interface TActivityMapper {
int deleteByPrimaryKey(Integer id);
int insert(TActivity record);
int insertSelective(TActivity record);
TActivity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TActivity record);
int updateByPrimaryKey(TActivity record);
@DataScope(tableAlias = "ta",tableField = "owner_id")
ArrayList<TActivity> selectActivityByPage(ActivityQuery activityQuery);
TActivity selectDetailByPrimaryKey(Integer id);
int deleteByIds(List<String> idList);
List<TActivity> selectOnGoingActivities();
Integer selectActivityCount();
}
package com.alatus.mapper;
import com.alatus.commons.DataScope;
import com.alatus.model.TActivity;
import com.alatus.query.ActivityQuery;
import java.util.ArrayList;
import java.util.List;
public interface TActivityMapper {
int deleteByPrimaryKey(Integer id);
int insert(TActivity record);
int insertSelective(TActivity record);
TActivity selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TActivity record);
int updateByPrimaryKey(TActivity record);
@DataScope(tableAlias = "ta",tableField = "owner_id")
ArrayList<TActivity> selectActivityByPage(ActivityQuery activityQuery);
TActivity selectDetailByPrimaryKey(Integer id);
int deleteByIds(List<String> idList);
List<TActivity> selectOnGoingActivities();
Integer selectActivityCount();
}
<?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.alatus.mapper.TActivityMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TActivity">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="cost" jdbcType="DECIMAL" property="cost" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<resultMap id="ActivityResultMap" type="com.alatus.model.TActivity">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="cost" jdbcType="DECIMAL" property="cost" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<!-- 一对一关联查询-->
<association property="ownerDO" javaType="com.alatus.model.TUser">
<id column="ownerId" jdbcType="INTEGER" property="id" />
<result column="ownerName" jdbcType="VARCHAR" property="name" />
</association>
<association property="createByDO" javaType="com.alatus.model.TUser">
<id column="createId" jdbcType="INTEGER" property="id" />
<result column="createName" jdbcType="VARCHAR" property="name" />
</association>
<association property="editByDO" javaType="com.alatus.model.TUser">
<id column="editId" jdbcType="INTEGER" property="id" />
<result column="editName" jdbcType="VARCHAR" property="name" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, owner_id, `name`, start_time, end_time, cost, description, create_time, create_by,
edit_time, edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_activity
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectActivityByPage" parameterType="java.lang.Integer" resultMap="ActivityResultMap">
select
ta.*,
tu.id ownerId, tu.name ownerName
from t_activity ta left join t_user tu on ta.owner_id = tu.id
<where>
<if test="ownerId != null">
and ta.owner_id = #{ownerId}
</if>
<if test="name != null">
and ta.name like concat ('%',#{name},'%')
</if>
<if test="startTime != null">
and ta.start_time >= #{startTime}
</if>
<if test="endTime != null">
<![CDATA[and ta.end_time <= #{endTime}]]>
</if>
<if test="cost != null">
and ta.cost >= #{cost}
</if>
<if test="createTime != null">
and ta.create_time >= #{createTime}
</if>
${filterSQL}
</where>
</select>
<select id="selectDetailByPrimaryKey" parameterType="java.lang.Integer" resultMap="ActivityResultMap">
select
ta.*,
tu1.id ownerId,tu1.name ownerName,
tu2.id createById,tu2.name createByName,
tu3.id editById,tu3.name editByName
from t_activity ta left join t_user tu1 on ta.owner_id = tu1.id
left join t_user tu2 on ta.create_by = tu2.id
left join t_user tu3 on ta.edit_by = tu3.id
where ta.id = #{id,jdbcType=INTEGER}
</select>
<select id="selectOnGoingActivities" resultMap="ActivityResultMap">
select
<include refid="Base_Column_List" />
from t_activity
where <![CDATA[ start_time <= now() and end_time >= now() ]]>
</select>
<select id="selectActivityCount" resultType="java.lang.Integer">
select count(0)
from t_activity
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_activity
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByIds" parameterType="java.util.List">
delete from t_activity
where id in
<foreach collection="idList" item="id" open="(" close=")" separator=",">
#{id,jdbcType=INTEGER}
</foreach>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TActivity" useGeneratedKeys="true">
insert into t_activity (owner_id, `name`, start_time,
end_time, cost, description,
create_time, create_by, edit_time,
edit_by)
values (#{ownerId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP}, #{cost,jdbcType=DECIMAL}, #{description,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP},
#{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TActivity" useGeneratedKeys="true">
insert into t_activity
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
owner_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="cost != null">
cost,
</if>
<if test="description != null">
description,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
#{ownerId,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="cost != null">
#{cost,jdbcType=DECIMAL},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TActivity">
update t_activity
<set>
<if test="ownerId != null">
owner_id = #{ownerId,jdbcType=INTEGER},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="cost != null">
cost = #{cost,jdbcType=DECIMAL},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TActivity">
update t_activity
set owner_id = #{ownerId,jdbcType=INTEGER},
`name` = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
cost = #{cost,jdbcType=DECIMAL},
description = #{description,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
<?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.alatus.mapper.TActivityMapper">
<resultMap id="BaseResultMap" type="com.alatus.model.TActivity">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="cost" jdbcType="DECIMAL" property="cost" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
</resultMap>
<resultMap id="ActivityResultMap" type="com.alatus.model.TActivity">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="owner_id" jdbcType="INTEGER" property="ownerId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="cost" jdbcType="DECIMAL" property="cost" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
<result column="edit_by" jdbcType="INTEGER" property="editBy" />
<!-- 一对一关联查询-->
<association property="ownerDO" javaType="com.alatus.model.TUser">
<id column="ownerId" jdbcType="INTEGER" property="id" />
<result column="ownerName" jdbcType="VARCHAR" property="name" />
</association>
<association property="createByDO" javaType="com.alatus.model.TUser">
<id column="createId" jdbcType="INTEGER" property="id" />
<result column="createName" jdbcType="VARCHAR" property="name" />
</association>
<association property="editByDO" javaType="com.alatus.model.TUser">
<id column="editId" jdbcType="INTEGER" property="id" />
<result column="editName" jdbcType="VARCHAR" property="name" />
</association>
</resultMap>
<sql id="Base_Column_List">
id, owner_id, `name`, start_time, end_time, cost, description, create_time, create_by,
edit_time, edit_by
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_activity
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectActivityByPage" parameterType="java.lang.Integer" resultMap="ActivityResultMap">
select
ta.*,
tu.id ownerId, tu.name ownerName
from t_activity ta left join t_user tu on ta.owner_id = tu.id
<where>
<if test="ownerId != null">
and ta.owner_id = #{ownerId}
</if>
<if test="name != null">
and ta.name like concat ('%',#{name},'%')
</if>
<if test="startTime != null">
and ta.start_time >= #{startTime}
</if>
<if test="endTime != null">
<![CDATA[and ta.end_time <= #{endTime}]]>
</if>
<if test="cost != null">
and ta.cost >= #{cost}
</if>
<if test="createTime != null">
and ta.create_time >= #{createTime}
</if>
${filterSQL}
</where>
</select>
<select id="selectDetailByPrimaryKey" parameterType="java.lang.Integer" resultMap="ActivityResultMap">
select
ta.*,
tu1.id ownerId,tu1.name ownerName,
tu2.id createById,tu2.name createByName,
tu3.id editById,tu3.name editByName
from t_activity ta left join t_user tu1 on ta.owner_id = tu1.id
left join t_user tu2 on ta.create_by = tu2.id
left join t_user tu3 on ta.edit_by = tu3.id
where ta.id = #{id,jdbcType=INTEGER}
</select>
<select id="selectOnGoingActivities" resultMap="ActivityResultMap">
select
<include refid="Base_Column_List" />
from t_activity
where <![CDATA[ start_time <= now() and end_time >= now() ]]>
</select>
<select id="selectActivityCount" resultType="java.lang.Integer">
select count(0)
from t_activity
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_activity
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByIds" parameterType="java.util.List">
delete from t_activity
where id in
<foreach collection="idList" item="id" open="(" close=")" separator=",">
#{id,jdbcType=INTEGER}
</foreach>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TActivity" useGeneratedKeys="true">
insert into t_activity (owner_id, `name`, start_time,
end_time, cost, description,
create_time, create_by, edit_time,
edit_by)
values (#{ownerId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP}, #{cost,jdbcType=DECIMAL}, #{description,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP},
#{editBy,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.alatus.model.TActivity" useGeneratedKeys="true">
insert into t_activity
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
owner_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="cost != null">
cost,
</if>
<if test="description != null">
description,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="editBy != null">
edit_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ownerId != null">
#{ownerId,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="cost != null">
#{cost,jdbcType=DECIMAL},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
#{editBy,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.alatus.model.TActivity">
update t_activity
<set>
<if test="ownerId != null">
owner_id = #{ownerId,jdbcType=INTEGER},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="cost != null">
cost = #{cost,jdbcType=DECIMAL},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="editBy != null">
edit_by = #{editBy,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.alatus.model.TActivity">
update t_activity
set owner_id = #{ownerId,jdbcType=INTEGER},
`name` = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
cost = #{cost,jdbcType=DECIMAL},
description = #{description,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=INTEGER},
edit_time = #{editTime,jdbcType=TIMESTAMP},
edit_by = #{editBy,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>