@ -40,40 +40,40 @@ public interface DetailYMapper {
} )
} )
DetailY selectByDetailyId ( Integer detaily_id ) ;
DetailY selectByDetailyId ( Integer detaily_id ) ;
@Select ( {
"<script>" ,
"SELECT " ,
"`user`.name,`user`.area,user_gold.buy_jb,user_gold.core_jb,user_gold.free_12,user_gold.free_6," ,
"user_gold.jwcode," ,
"SUM(CASE WHEN detail_y.update_type = 0 THEN detail_y.recharge_coin ELSE 0 END) AS Rcoin," ,
"SUM(CASE WHEN detail_y.update_type = 1 THEN detail_y.recharge_coin + detail_y.free_coin + detail_y.task_coin ELSE 0 END) AS Scoin" ,
"FROM " ,
"detail_y" ,
"LEFT JOIN " ,
"user_gold ON detail_y.jwcode = user_gold.jwcode" ,
"LEFT JOIN" ,
"`user` ON detail_y.jwcode = `user`.jwcode" ,
"<where>" ,
"<if test='jwcode!=null and jwcode.length>0'>and detail_y.jwcode=#{jwcode}</if>" ,
"<if test='area!=null and area.length>0'>AND `user`.area=#{area}</if>" ,
"</where>" ,
"GROUP BY" ,
"user_gold.jwcode" ,
"<choose>" ,
" <!-- 优先使用前端传入的排序参数 -->" ,
" <when test='sortField != null or sortOrder != null'>" ,
" ORDER BY ${sortField} ${sortOrder}" ,
" </when>" ,
" <!-- 默认排序 -->" ,
" <otherwise>" ,
"ORDER BY " ,
"Rcoin DESC" ,
" </otherwise>" ,
"</choose>" ,
"</script>"
} )
/ / @Select ( {
/ / "<script>" ,
/ / "SELECT " ,
/ / "`user`.name,`user`.area,user_gold.buy_jb,user_gold.core_jb,user_gold.free_12,user_gold.free_6," ,
/ / "user_gold.jwcode," ,
/ / "SUM(CASE WHEN detail_y.update_type = 0 THEN detail_y.recharge_coin ELSE 0 END) AS Rcoin," ,
/ / "SUM(CASE WHEN detail_y.update_type = 1 THEN detail_y.recharge_coin + detail_y.free_coin + detail_y.task_coin ELSE 0 END) AS Scoin" ,
/ / "FROM " ,
/ / "detail_y" ,
/ / "LEFT JOIN " ,
/ / "user_gold ON detail_y.jwcode = user_gold.jwcode" ,
/ / "LEFT JOIN" ,
/ / "`user` ON detail_y.jwcode = `user`.jwcode" ,
/ / "<where>" ,
/ / "<if test='jwcode!=null and jwcode.length>0'>and detail_y.jwcode=#{jwcode}</if>" ,
/ / "<if test='area!=null and area.length>0'>AND `user`.area=#{area}</if>" ,
/ / "</where>" ,
/ / "GROUP BY" ,
/ / "user_gold.jwcode" ,
/ /
/ / "<choose>" ,
/ / " <!-- 优先使用前端传入的排序参数 -->" ,
/ / " <when test='sortField != null or sortOrder != null'>" ,
/ / " ORDER BY ${sortField} ${sortOrder}" ,
/ / " </when>" ,
/ / " <!-- 默认排序 -->" ,
/ / " <otherwise>" ,
/ / "ORDER BY " ,
/ / "Rcoin DESC" ,
/ / " </otherwise>" ,
/ / "</choose>" ,
/ / "</script>"
/ /
/ / } )
List < DetailYgold > selectgold ( DetailYgold detailYgold ) ;
List < DetailYgold > selectgold ( DetailYgold detailYgold ) ;
/ / @Select ( {
/ / @Select ( {
@ -110,22 +110,22 @@ public interface DetailYMapper {
List < DetailY > select1 ( DetailY detailY ) ;
List < DetailY > select1 ( DetailY detailY ) ;
@Select ( {
"<script>" ,
"SELECT" ,
" SUM(`recharge_coin`) AS 'sumR'," ,
" SUM(`task_coin`) AS 'sumT'," ,
" SUM(`free_coin`) AS 'sumF'" ,
"FROM" ,
"`detail_y`" ,
"<where>" ,
"<if test='jwcode!=null and jwcode.length>0'>AND jwcode=#{jwcode}</if>" ,
"<if test='updateType!=null'>AND update_type=#{updateType}</if>" ,
"<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>" ,
"<if test='area!=null and area.length>0'>AND area=#{area}</if>" ,
"</where>" ,
"</script>"
} )
/ / @Select ( {
/ / "<script>" ,
/ / "SELECT" ,
/ / " SUM(`recharge_coin`) AS 'sumR'," ,
/ / " SUM(`task_coin`) AS 'sumT'," ,
/ / " SUM(`free_coin`) AS 'sumF'" ,
/ / "FROM" ,
/ / "`detail_y`" ,
/ / "<where>" ,
/ / "<if test='jwcode!=null and jwcode.length>0'>AND jwcode=#{jwcode}</if>" ,
/ / "<if test='updateType!=null'>AND update_type=#{updateType}</if>" ,
/ / "<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>" ,
/ / "<if test='area!=null and area.length>0'>AND area=#{area}</if>" ,
/ / "</where>" ,
/ / "</script>"
/ / } )
DetailY getCount ( DetailY detailY ) ;
DetailY getCount ( DetailY detailY ) ;
/ / 导出数据的SQL
/ / 导出数据的SQL
@ -143,20 +143,20 @@ public interface DetailYMapper {
@Select ( "SELECT COUNT(*) FROM detail_y" )
@Select ( "SELECT COUNT(*) FROM detail_y" )
int getTotalCount ( ) ;
int getTotalCount ( ) ;
@Select ( {
"<script>" ,
"SELECT d.detaily_id,u.name,d.jwcode,u.area,d.consume_platform,d.update_type,d.recharge_coin,d.task_coin," +
"d.free_coin,d.create_admin,d.create_time" ,
"FROM detail_y d" ,
"LEFT JOIN user u on d.jwcode = u.jwcode " ,
"<where>" ,
"<if test='updateType!=null'>AND d.update_type=#{updateType}</if>" ,
"<if test='jwcode!=null'>AND d.jwcode=#{jwcode}</if>" ,
"<if test='area != null '>AND u.area=#{area}</if>" ,
"<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>" ,
"</where>" ,
"ORDER BY detaily_id desc" ,
"</script>"
} )
/ / @Select ( {
/ / "<script>" ,
/ / "SELECT d.detaily_id,u.name,d.jwcode,u.area,d.consume_platform,d.update_type,d.recharge_coin,d.task_coin," +
/ / "d.free_coin,d.create_admin,d.create_time" ,
/ / "FROM detail_y d" ,
/ / "LEFT JOIN user u on d.jwcode = u.jwcode " ,
/ / "<where>" ,
/ / "<if test='updateType!=null'>AND d.update_type=#{updateType}</if>" ,
/ / "<if test='jwcode!=null'>AND d.jwcode=#{jwcode}</if>" ,
/ / "<if test='area != null '>AND u.area=#{area}</if>" ,
/ / "<if test='startDate != null and endDate != null'>AND create_time BETWEEN #{startDate} AND #{endDate}</if>" ,
/ / "</where>" ,
/ / "ORDER BY detaily_id desc" ,
/ / "</script>"
/ / } )
List < UserDetailExport > searchAll ( DetailExport detailExport ) ;
List < UserDetailExport > searchAll ( DetailExport detailExport ) ;
}
}