"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
c.customerId,c.LoginName,c.Uimage,c.Pwd,c.NikeName,c.Mobile,c.qq,c.MaxOnline,date_format(c.regtime,'%Y-%m-%d %H:%i:%s') regtimestr,c.RegFrom,c.Email,c.GroupId,g.GroupName,c.account,c.tranche,c.custBution,
c.fromCus,c.orgCode,c.customerKey,date_format(c.expiryDate,'%Y-%m-%d') expiryDateStr,dateInterval,effDay
c.customerId,g.GroupName,c.account,c.tranche,c.custBution
and c.orgCode = #{orgCode}
and c.LoginName like CONCAT("%",#{loginName},"%")
and c.NikeName like CONCAT("%",#{nikeName},"%")
and c.Mobile like CONCAT("%",#{mobile},"%")
and c.qq like CONCAT("%",#{qq},"%")
and c.wx like CONCAT("%",#{wx},"%")
and Date(c.RegTime) >= #{regBeginDate}
]]>
and Date(c.RegTime) <= #{regEndDate}
]]>
and c.GroupId=#{groupId}
and g.GroupType=#{type}
and LOWER(c.RegFrom)=#{regFrom}
and c.account like CONCAT("%",#{account},"%")
and c.tranche like CONCAT("%",#{tranche},"%")
and c.custBution like CONCAT("%",#{custBution},"%")
and c.State=1
and c.orgCode =#{orgCode}
and c.customerId like CONCAT("%",#{customerId},"%")
and c.account like CONCAT("%",#{account},"%")
and c.tranche like CONCAT("%",#{tranche},"%")
and c.custBution like CONCAT("%",#{custBution},"%")
and c.State=1 and g.GroupType=1
select
from cus_customer c left join cus_group g on g.GroupId=c.GroupId
order by ${sort} desc
]]>
limit #{pageStart}, #{pageSize}
select
from cus_customer c left join cus_group g on g.GroupId=c.GroupId
order by ${sort} desc
]]>
limit #{pageStart}, #{pageSize}
select count(1) total
from cus_customer c left join cus_group g on g.GroupId=c.GroupId
select count(1) total
from cus_customer c left join cus_group g on g.GroupId=c.GroupId
select
from cus_customer c inner join cus_group g on g.GroupId=c.GroupId
where customerId=#{customerId}
select
from cus_customer c left join cus_group g on g.GroupId=c.GroupId
select
from cus_customer c left join cus_group g on g.GroupId=c.GroupId
order by c.RegTime desc limit ${record}
insert into
cus_customer(LoginName,Pwd,Mobile,GroupId,NikeName,qq,RegTime,Email,MaxOnline,
State,Uimage,RegFrom,CreateId,CreateTime,account,tranche,custBution,fromCus,orgCode,customerKey)
values(#{loginName},#{pwd},#{mobile},#{groupId},#{nikeName},#{qq},#{regTime},#{email},#{maxOnline},
#{state},#{uImage},#{regFrom},#{createId},#{createTime},
#{account},#{tranche},#{custBution},#{fromCus},#{orgCode},#{customerKey})
update cus_customer set GroupId=#{groupId},Uimage=#{uImage},Pwd=#{pwd},NikeName=#{nikeName},
qq=#{qq},Email=#{email},Mobile=#{mobile},MaxOnline=#{maxOnline},account=#{account},tranche=#{tranche},custBution=#{custBution},
expiryDate=#{expiryDate},dateInterval=#{dateInterval},effDay=#{effDay}
where customerId=#{customerId}
select IFNULL(LoginName,NikeName) as loginname from cus_customer where customerId in
#{item}
update cus_customer set GroupId=#{groupId} where customerId in
#{item}
update cus_customer set State=#{state} where customerId in
#{item}
update cus_customer set tranche=#{tranche},custBution=#{custBution} where customerId=#{customerId}
select count(1) total from cus_customer where LoginName=#{loginName} and orgCode=#{orgCode}
select count(1) total from cus_customer where Mobile=#{mobile} and orgCode=#{orgCode}
select DISTINCT LOWER(RegFrom) from cus_customer where State=1 and RegFrom is not NULL and RegFrom!=''
delete from tmp_customer;
insert into tmp_customer(LoginName,Pwd,Uimage,NikeName,Mobile,Email,RegTime,GroupId,RegFrom,MaxOnline,State,CreateId,CreateTime,Money)
values
(#{obj.loginName},#{obj.pwd},#{obj.uImage},#{obj.nikeName},#{obj.mobile},#{obj.email},#{obj.regTime},#{obj.groupId},#{obj.regFrom},#{obj.maxOnline},
#{obj.state},#{obj.createId},#{obj.createTime},#{obj.money})
insert into cus_customer(LoginName,Pwd,Uimage,NikeName,Mobile,Email,RegTime,GroupId,RegFrom,MaxOnline,State,CreateId,CreateTime,Money)
select * from tmp_customer t
where NOT EXISTS
(SELECT 1 from cus_customer c where c.LoginName=t.LoginName or c.Mobile=t.Mobile)
insert into cus_costomer_up_history(CustomerId,SgroupId,EgroupId,ChangeDate,CreateId,CreateTime)
select c.customerId,0,c.GroupId,NOW(),c.CreateId,NOW() from cus_customer c
where c.customerId =#{customerId}
insert into cus_costomer_up_history(CustomerId,SgroupId,EgroupId,ChangeDate,CreateId,CreateTime)
select c.customerId,c.GroupId,#{groupId},NOW(),#{userId},NOW() from cus_customer c
where c.customerId =#{customerId}
insert into cus_costomer_up_history(CustomerId,SgroupId,EgroupId,ChangeDate,CreateId,CreateTime)
select c.customerId,c.GroupId,#{groupId},NOW(),#{userId},NOW() from cus_customer c
where c.customerId in
#{item}
and c.GroupId!=#{groupId}
SELECT t.customerId as custId,t.Mobile as mobile,g.GroupId as groupId,g.GroupName as groupName from cus_customer t
INNER JOIN cus_group g on t.GroupId=g.GroupId where 1=1
and t.LoginName=#{loginName}
and t.Mobile=#{mobile}
and t.customerId=#{custId}
select count(1) total from cus_customer where account=#{account}
select c.customerId,c.LoginName,c.NikeName,c.Mobile from cus_customer c where c.Mobile=#{mobile}
update cus_customer c set expiryDate=NULL,dateInterval=NULL,effDay=NULL,GroupId=(
SELECT g.GroupId from cus_group g
where c.orgCode=g.OrgCode
and g.groupname='注册用户'
) where expiryDate is not null and datediff(expiryDate,now())=0
select c.customerId,c.LoginName,c.NikeName,c.Mobile from cus_customer c where c.customerKey=#{customerKey}
update cus_customer set LoginName=#{loginName},Pwd=#{pwd},Uimage=#{uImage},NikeName=#{nikeName},qq=#{qq},Email=#{email},
Mobile=#{mobile},GroupId=#{groupId},RegFrom=#{regFrom},MaxOnline=#{maxOnline},account=#{account},tranche=#{tranche},custBution=#{custBution},CreateId=#{createId},
expiryDate=#{expiryDate},dateInterval=#{dateInterval},effDay=#{effDay}
where customerId=#{customerId}
update cus_customer set expiryDate=NULL,dateInterval=NULL,effDay=NULL,GroupId=#{groupId} where customerId in
#{item}
update cus_customer set GroupId=#{groupId},Uimage=#{uImage},Pwd=#{pwd},NikeName=#{nikeName},
qq=#{qq},Email=#{email},Mobile=#{mobile},MaxOnline=#{maxOnline},account=#{account},tranche=#{tranche},custBution=#{custBution},
expiryDate=NULL,dateInterval=NULL,effDay=NULL
where customerId=#{customerId}
一个牛人的博客
https://github.com/abel533/Mapper