Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
84f93740
Commit
84f93740
authored
Nov 11, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到
parent
9f276395
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1561 additions
and
7 deletions
+1561
-7
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSigninDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSigninDao.java
+17
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSignin.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSignin.java
+258
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSigninExample.java
...rc/main/java/com/wwdz/ch/db/domain/UserSigninExample.java
+831
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/UserSigninRequestDto.java
...java/com/wwdz/ch/db/dto/request/UserSigninRequestDto.java
+30
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserSigninDaoImpl.java
.../src/main/java/com/wwdz/ch/db/impl/UserSigninDaoImpl.java
+58
-0
ch-dao/src/main/java/com/wwdz/ch/db/mapper/UserSigninMapper.java
...src/main/java/com/wwdz/ch/db/mapper/UserSigninMapper.java
+69
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/UserSigninMapper.xml
...main/resources/com/wwdz/ch/db/mapper/UserSigninMapper.xml
+291
-0
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+4
-4
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
+3
-3
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserSigninDao.java
0 → 100644
View file @
84f93740
package
com.wwdz.ch.db.dao
;
import
com.wwdz.ch.db.domain.UserSignin
;
import
com.wwdz.ch.db.dto.request.UserSigninRequestDto
;
import
java.util.List
;
public
interface
UserSigninDao
{
boolean
insert
(
UserSignin
userSignin
);
UserSignin
findLastedRecord
(
long
userId
);
List
<
UserSignin
>
findList
(
UserSigninRequestDto
dto
);
UserSignin
findYesterdayRecord
(
long
userId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSignin.java
0 → 100644
View file @
84f93740
package
com.wwdz.ch.db.domain
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
* @author shiyu
* @date 2024/11/11
*/
@Data
public
class
UserSignin
implements
Entity
{
/**
* id
*/
private
Long
id
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 签到时间
*/
private
Date
signinTime
;
/**
* 连续天数
*/
private
Integer
consecutiveDays
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", signinTime="
).
append
(
signinTime
);
sb
.
append
(
", consecutiveDays="
).
append
(
consecutiveDays
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
UserSignin
other
=
(
UserSignin
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getSigninTime
()
==
null
?
other
.
getSigninTime
()
==
null
:
this
.
getSigninTime
().
equals
(
other
.
getSigninTime
()))
&&
(
this
.
getConsecutiveDays
()
==
null
?
other
.
getConsecutiveDays
()
==
null
:
this
.
getConsecutiveDays
().
equals
(
other
.
getConsecutiveDays
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getSigninTime
()
==
null
)
?
0
:
getSigninTime
().
hashCode
());
result
=
prime
*
result
+
((
getConsecutiveDays
()
==
null
)
?
0
:
getConsecutiveDays
().
hashCode
());
return
result
;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
enum
Column
{
id
(
"id"
,
"id"
,
"BIGINT"
,
false
),
userId
(
"user_id"
,
"userId"
,
"BIGINT"
,
false
),
signinTime
(
"signin_time"
,
"signinTime"
,
"TIMESTAMP"
,
false
),
consecutiveDays
(
"consecutive_days"
,
"consecutiveDays"
,
"INTEGER"
,
false
);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
BEGINNING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
ENDING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
column
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
boolean
isColumnNameDelimited
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
javaProperty
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
jdbcType
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
value
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getValue
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJavaProperty
()
{
return
this
.
javaProperty
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJdbcType
()
{
return
this
.
jdbcType
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column
(
String
column
,
String
javaProperty
,
String
jdbcType
,
boolean
isColumnNameDelimited
)
{
this
.
column
=
column
;
this
.
javaProperty
=
javaProperty
;
this
.
jdbcType
=
jdbcType
;
this
.
isColumnNameDelimited
=
isColumnNameDelimited
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
desc
()
{
return
this
.
getEscapedColumnName
()
+
" DESC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
asc
()
{
return
this
.
getEscapedColumnName
()
+
" ASC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
static
Column
[]
excludes
(
Column
...
excludes
)
{
ArrayList
<
Column
>
columns
=
new
ArrayList
<>(
Arrays
.
asList
(
Column
.
values
()));
if
(
excludes
!=
null
&&
excludes
.
length
>
0
)
{
columns
.
removeAll
(
new
ArrayList
<>(
Arrays
.
asList
(
excludes
)));
}
return
columns
.
toArray
(
new
Column
[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getEscapedColumnName
()
{
if
(
this
.
isColumnNameDelimited
)
{
return
new
StringBuilder
().
append
(
BEGINNING_DELIMITER
).
append
(
this
.
column
).
append
(
ENDING_DELIMITER
).
toString
();
}
else
{
return
this
.
column
;
}
}
}
}
\ No newline at end of file
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserSigninExample.java
0 → 100644
View file @
84f93740
package
com.wwdz.ch.db.domain
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
public
class
UserSigninExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
UserSigninExample
()
{
oredCriteria
=
new
ArrayList
<
Criteria
>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
UserSigninExample
orderBy
(
String
orderByClause
)
{
this
.
setOrderByClause
(
orderByClause
);
return
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
UserSigninExample
orderBy
(
String
...
orderByClauses
)
{
StringBuffer
sb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
orderByClauses
.
length
;
i
++)
{
sb
.
append
(
orderByClauses
[
i
]);
if
(
i
<
orderByClauses
.
length
-
1
)
{
sb
.
append
(
" , "
);
}
}
this
.
setOrderByClause
(
sb
.
toString
());
return
this
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
(
this
);
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
static
Criteria
newAndCreateCriteria
()
{
UserSigninExample
example
=
new
UserSigninExample
();
return
example
.
createCriteria
();
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
Long
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIdEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIdNotEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
Long
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIdGreaterThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIdGreaterThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
Long
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIdLessThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIdLessThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdIsNull
()
{
addCriterion
(
"user_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdIsNotNull
()
{
addCriterion
(
"user_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdEqualTo
(
Long
value
)
{
addCriterion
(
"user_id ="
,
value
,
"userId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andUserIdEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"user_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"user_id <>"
,
value
,
"userId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andUserIdNotEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"user_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdGreaterThan
(
Long
value
)
{
addCriterion
(
"user_id >"
,
value
,
"userId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andUserIdGreaterThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"user_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"user_id >="
,
value
,
"userId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andUserIdGreaterThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"user_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdLessThan
(
Long
value
)
{
addCriterion
(
"user_id <"
,
value
,
"userId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andUserIdLessThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"user_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"user_id <="
,
value
,
"userId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andUserIdLessThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"user_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"user_id in"
,
values
,
"userId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"user_id not in"
,
values
,
"userId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"user_id between"
,
value1
,
value2
,
"userId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUserIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"user_id not between"
,
value1
,
value2
,
"userId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeIsNull
()
{
addCriterion
(
"signin_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeIsNotNull
()
{
addCriterion
(
"signin_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeEqualTo
(
Date
value
)
{
addCriterion
(
"signin_time ="
,
value
,
"signinTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSigninTimeEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signin_time = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"signin_time <>"
,
value
,
"signinTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSigninTimeNotEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signin_time <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"signin_time >"
,
value
,
"signinTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSigninTimeGreaterThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signin_time > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"signin_time >="
,
value
,
"signinTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSigninTimeGreaterThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signin_time >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeLessThan
(
Date
value
)
{
addCriterion
(
"signin_time <"
,
value
,
"signinTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSigninTimeLessThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signin_time < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"signin_time <="
,
value
,
"signinTime"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andSigninTimeLessThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"signin_time <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"signin_time in"
,
values
,
"signinTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"signin_time not in"
,
values
,
"signinTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"signin_time between"
,
value1
,
value2
,
"signinTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSigninTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"signin_time not between"
,
value1
,
value2
,
"signinTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysIsNull
()
{
addCriterion
(
"consecutive_days is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysIsNotNull
()
{
addCriterion
(
"consecutive_days is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysEqualTo
(
Integer
value
)
{
addCriterion
(
"consecutive_days ="
,
value
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andConsecutiveDaysEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"consecutive_days = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysNotEqualTo
(
Integer
value
)
{
addCriterion
(
"consecutive_days <>"
,
value
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andConsecutiveDaysNotEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"consecutive_days <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysGreaterThan
(
Integer
value
)
{
addCriterion
(
"consecutive_days >"
,
value
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andConsecutiveDaysGreaterThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"consecutive_days > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"consecutive_days >="
,
value
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andConsecutiveDaysGreaterThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"consecutive_days >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysLessThan
(
Integer
value
)
{
addCriterion
(
"consecutive_days <"
,
value
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andConsecutiveDaysLessThanColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"consecutive_days < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"consecutive_days <="
,
value
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andConsecutiveDaysLessThanOrEqualToColumn
(
UserSignin
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"consecutive_days <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"consecutive_days in"
,
values
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"consecutive_days not in"
,
values
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"consecutive_days between"
,
value1
,
value2
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
public
Criteria
andConsecutiveDaysNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"consecutive_days not between"
,
value1
,
value2
,
"consecutiveDays"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
UserSigninExample
example
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected
Criteria
(
UserSigninExample
example
)
{
super
();
this
.
example
=
example
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
UserSigninExample
example
()
{
return
this
.
example
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIf
(
boolean
ifAdd
,
ICriteriaAdd
add
)
{
if
(
ifAdd
)
{
add
.
add
(
this
);
}
return
this
;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
interface
ICriteriaAdd
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria
add
(
Criteria
add
);
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
\ No newline at end of file
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/UserSigninRequestDto.java
0 → 100644
View file @
84f93740
package
com.wwdz.ch.db.dto.request
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
UserSigninRequestDto
extends
BaseRequestDto
implements
Entity
{
/**
* id
*/
private
Long
id
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 签到时间
*/
private
Date
signinTime
;
/**
* 连续天数
*/
private
Integer
consecutiveDays
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserSigninDaoImpl.java
0 → 100644
View file @
84f93740
package
com.wwdz.ch.db.impl
;
import
com.wwdz.ch.db.dao.UserSigninDao
;
import
com.wwdz.ch.db.domain.UserSignin
;
import
com.wwdz.ch.db.domain.UserSigninExample
;
import
com.wwdz.ch.db.dto.request.UserSigninRequestDto
;
import
com.wwdz.ch.db.mapper.UserSigninMapper
;
import
com.xxdxxs.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.util.List
;
@Repository
public
class
UserSigninDaoImpl
implements
UserSigninDao
{
@Autowired
UserSigninMapper
userSigninMapper
;
@Override
public
boolean
insert
(
UserSignin
userSignin
)
{
return
userSigninMapper
.
insert
(
userSignin
)
>
0
;
}
@Override
public
UserSignin
findLastedRecord
(
long
userId
)
{
UserSigninExample
example
=
new
UserSigninExample
();
UserSigninExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
example
.
setOrderByClause
(
"signin_time desc"
);
return
userSigninMapper
.
selectOneByExample
(
example
);
}
@Override
public
List
<
UserSignin
>
findList
(
UserSigninRequestDto
dto
)
{
UserSigninExample
example
=
new
UserSigninExample
();
UserSigninExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
dto
.
getUserId
());
example
.
setOrderByClause
(
"signin_time desc"
);
return
userSigninMapper
.
selectByExample
(
example
);
}
@Override
public
UserSignin
findYesterdayRecord
(
long
userId
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
yesterday
=
now
.
minusDays
(
1
);
LocalDateTime
minTime
=
yesterday
.
with
(
LocalTime
.
MIN
);
LocalDateTime
maxTime
=
yesterday
.
with
(
LocalTime
.
MAX
);
UserSigninExample
example
=
new
UserSigninExample
();
UserSigninExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andSigninTimeGreaterThanOrEqualTo
(
DateUtils
.
fromLocalDateTime
(
minTime
));
criteria
.
andSigninTimeLessThanOrEqualTo
(
DateUtils
.
fromLocalDateTime
(
maxTime
));
return
userSigninMapper
.
selectOneByExample
(
example
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/mapper/UserSigninMapper.java
0 → 100644
View file @
84f93740
package
com.wwdz.ch.db.mapper
;
import
com.wwdz.ch.db.domain.UserSignin
;
import
com.wwdz.ch.db.domain.UserSigninExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
UserSigninMapper
{
long
countByExample
(
UserSigninExample
example
);
int
deleteByExample
(
UserSigninExample
example
);
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
UserSignin
record
);
int
insertSelective
(
UserSignin
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserSignin
selectOneByExample
(
UserSigninExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserSignin
selectOneByExampleSelective
(
@Param
(
"example"
)
UserSigninExample
example
,
@Param
(
"selective"
)
UserSignin
.
Column
...
selective
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List
<
UserSignin
>
selectByExampleSelective
(
@Param
(
"example"
)
UserSigninExample
example
,
@Param
(
"selective"
)
UserSignin
.
Column
...
selective
);
List
<
UserSignin
>
selectByExample
(
UserSigninExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_signin
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserSignin
selectByPrimaryKeySelective
(
@Param
(
"id"
)
Long
id
,
@Param
(
"selective"
)
UserSignin
.
Column
...
selective
);
UserSignin
selectByPrimaryKey
(
Long
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
UserSignin
record
,
@Param
(
"example"
)
UserSigninExample
example
);
int
updateByExample
(
@Param
(
"record"
)
UserSignin
record
,
@Param
(
"example"
)
UserSigninExample
example
);
int
updateByPrimaryKeySelective
(
UserSignin
record
);
int
updateByPrimaryKey
(
UserSignin
record
);
}
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/UserSigninMapper.xml
0 → 100644
View file @
84f93740
<?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.wwdz.ch.db.mapper.UserSigninMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.wwdz.ch.db.domain.UserSignin"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"signin_time"
jdbcType=
"TIMESTAMP"
property=
"signinTime"
/>
<result
column=
"consecutive_days"
jdbcType=
"INTEGER"
property=
"consecutiveDays"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, user_id, signin_time, consecutive_days
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.UserSigninExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from user_signin
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByExampleSelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if
test=
"example.distinct"
>
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, signin_time, consecutive_days
</otherwise>
</choose>
from user_signin
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from user_signin
where id = #{id,jdbcType=BIGINT}
</select>
<select
id=
"selectByPrimaryKeySelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, signin_time, consecutive_days
</otherwise>
</choose>
from user_signin
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from user_signin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.wwdz.ch.db.domain.UserSigninExample"
>
delete from user_signin
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.wwdz.ch.db.domain.UserSignin"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_signin (user_id, signin_time, consecutive_days
)
values (#{userId,jdbcType=BIGINT}, #{signinTime,jdbcType=TIMESTAMP}, #{consecutiveDays,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.UserSignin"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_signin
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"signinTime != null"
>
signin_time,
</if>
<if
test=
"consecutiveDays != null"
>
consecutive_days,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"userId != null"
>
#{userId,jdbcType=BIGINT},
</if>
<if
test=
"signinTime != null"
>
#{signinTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"consecutiveDays != null"
>
#{consecutiveDays,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.UserSigninExample"
resultType=
"java.lang.Long"
>
select count(*) from user_signin
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update user_signin
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.userId != null"
>
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if
test=
"record.signinTime != null"
>
signin_time = #{record.signinTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.consecutiveDays != null"
>
consecutive_days = #{record.consecutiveDays,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update user_signin
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
signin_time = #{record.signinTime,jdbcType=TIMESTAMP},
consecutive_days = #{record.consecutiveDays,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.wwdz.ch.db.domain.UserSignin"
>
update user_signin
<set>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=BIGINT},
</if>
<if
test=
"signinTime != null"
>
signin_time = #{signinTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"consecutiveDays != null"
>
consecutive_days = #{consecutiveDays,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.wwdz.ch.db.domain.UserSignin"
>
update user_signin
set user_id = #{userId,jdbcType=BIGINT},
signin_time = #{signinTime,jdbcType=TIMESTAMP},
consecutive_days = #{consecutiveDays,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.UserSigninExample"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from user_signin
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
limit 1
</select>
<select
id=
"selectOneByExampleSelective"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length > 0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, signin_time, consecutive_days
</otherwise>
</choose>
from user_signin
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
<if
test=
"example.orderByClause != null"
>
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
84f93740
...
@@ -63,16 +63,16 @@
...
@@ -63,16 +63,16 @@
<!--生成Model类存放位置-->
<!--生成Model类存放位置-->
<javaModelGenerator
targetPackage=
"com.wwdz.ch.db.domain
.openShop
"
targetProject=
"ch-dao/src/main/java"
>
<javaModelGenerator
targetPackage=
"com.wwdz.ch.db.domain"
targetProject=
"ch-dao/src/main/java"
>
<property
name=
"enableSubPackages"
value=
"true"
/>
<property
name=
"enableSubPackages"
value=
"true"
/>
<property
name=
"trimStrings"
value=
"true"
/>
<property
name=
"trimStrings"
value=
"true"
/>
</javaModelGenerator>
</javaModelGenerator>
<sqlMapGenerator
targetPackage=
"com.wwdz.ch.db.mapper
.openShop
"
targetProject=
"ch-dao/src/main/resources"
/>
<sqlMapGenerator
targetPackage=
"com.wwdz.ch.db.mapper"
targetProject=
"ch-dao/src/main/resources"
/>
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper
.openShop
"
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper"
targetProject=
"ch-dao/src/main/java"
/>
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"user_
account
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"user_
signin
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
</table>
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
View file @
84f93740
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
@Test
@Test
public
void
refund
()
{
public
void
refund
()
{
List
<
String
>
list
=
Arrays
.
asList
(
"DA24110
42000269405675
"
);
List
<
String
>
list
=
Arrays
.
asList
(
"DA24110
91934133307007
"
);
list
.
forEach
(
orderId
->{
list
.
forEach
(
orderId
->{
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setAmount
(
"
3
0"
);
dto
.
setAmount
(
"
2
0"
);
dto
.
setRefundPrice
(
"
3
0"
);
dto
.
setRefundPrice
(
"
2
0"
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment