数据库第二次大作业boostore
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

103 Zeilen
3.0 KiB

<!DOCTYPE html>
<html id="htmlId">
<head>
<title>Coverage Report > UserMapper</title>
<style type="text/css">
@import "../../css/coverage.css";
@import "../../css/idea.min.css";
</style>
<script type="text/javascript" src="../../js/highlight.min.js"></script>
<script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>
<body>
<div class="content">
<div class="breadCrumbs">
Current scope: <a href="../../index.html">all classes</a>
<span class="separator">|</span>
<a href="../index.html">cn.edu.ecnu.stu.bookstore.mapper</a>
</div>
<h1>Coverage Summary for Class: UserMapper (cn.edu.ecnu.stu.bookstore.mapper)</h1>
<table class="coverageStats">
<tr>
<th class="name">Class</th>
</tr>
<tr>
<td class="name">UserMapper</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package cn.edu.ecnu.stu.bookstore.mapper;
&nbsp;
&nbsp;import cn.edu.ecnu.stu.bookstore.pojo.User;
&nbsp;import org.apache.ibatis.annotations.Mapper;
&nbsp;import org.apache.ibatis.annotations.Param;
&nbsp;import org.apache.ibatis.annotations.Select;
&nbsp;import org.apache.ibatis.annotations.Update;
&nbsp;
&nbsp;import java.math.BigDecimal;
&nbsp;
&nbsp;@Mapper
&nbsp;public interface UserMapper {
&nbsp;
&nbsp; int insert(@Param(&quot;user&quot;) User user);
&nbsp;
&nbsp; int delete(@Param(&quot;userId&quot;) int userId);
&nbsp;
&nbsp; int checkUserByUsername(@Param(&quot;username&quot;) String username);
&nbsp;
&nbsp; int deleteByName(@Param(&quot;username&quot;) String username);
&nbsp;
&nbsp; @Select(&quot;select id, username, password, address, phone, balance from t_user where id = #{id}&quot;)
&nbsp; User selectOneById(@Param(&quot;id&quot;) Integer id);
&nbsp;
&nbsp; @Select(&quot;select id, username, password, address, phone, balance from t_user where username = #{username}&quot;)
&nbsp; User selectOneByName(@Param(&quot;username&quot;) String username);
&nbsp;
&nbsp; @Update(&quot;update t_user set password = #{password} where username = #{username}&quot;)
&nbsp; int updatePassword(@Param(&quot;username&quot;) String username, @Param(&quot;password&quot;) String password);
&nbsp;
&nbsp; @Update(&quot;update t_user set balance = balance - #{price} where id = #{userId}&quot;)
&nbsp; int minusBalance(@Param(&quot;userId&quot;) int userId, @Param(&quot;price&quot;) BigDecimal price);
&nbsp;
&nbsp; @Update(&quot;update t_user set balance = balance + #{addValue} where id = #{userId}&quot;)
&nbsp; void addBalance(@Param(&quot;userId&quot;) Integer userId,@Param(&quot;addValue&quot;) BigDecimal addValue);
&nbsp;}
</code>
</pre>
</div>
<script type="text/javascript">
(function() {
var msie = false, msie9 = false;
/*@cc_on
msie = true;
@if (@_jscript_version >= 9)
msie9 = true;
@end
@*/
if (!msie || msie && msie9) {
hljs.highlightAll()
hljs.initLineNumbersOnLoad();
}
})();
</script>
<div class="footer">
<div style="float:right;">generated on 2023-12-12 18:32</div>
</div>
</body>
</html>