forked from ps2hc5nfx/youxi
commit
e506eb8f2d
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
|
||||||
|
<classpathentry kind="src" path="src/main/java"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="owner.project.facets" value="jst.web"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||||
|
<classpathentry kind="output" path="build/classes"/>
|
||||||
|
</classpath>
|
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>youxi</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="hide" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
@ -0,0 +1,10 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=17
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.source=17
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
<wb-module deploy-name="youxi">
|
||||||
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
<property name="context-root" value="youxi"/>
|
||||||
|
<property name="java-output-path" value="/youxi/build/classes"/>
|
||||||
|
</wb-module>
|
||||||
|
</project-modules>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<faceted-project>
|
||||||
|
<runtime name="Apache Tomcat v8.5"/>
|
||||||
|
<fixed facet="jst.web"/>
|
||||||
|
<fixed facet="wst.jsdt.web"/>
|
||||||
|
<fixed facet="java"/>
|
||||||
|
<installed facet="java" version="17"/>
|
||||||
|
<installed facet="jst.web" version="3.1"/>
|
||||||
|
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||||
|
</faceted-project>
|
@ -0,0 +1 @@
|
|||||||
|
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
@ -0,0 +1 @@
|
|||||||
|
Window
|
@ -0,0 +1,9 @@
|
|||||||
|
DELEGATES_PREFERENCE=delegateValidatorList
|
||||||
|
USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
|
||||||
|
USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;
|
||||||
|
USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.801.v202007142017
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
override=true
|
||||||
|
suspend=false
|
||||||
|
vals/org.eclipse.wst.xml.core.xml/global=FF03
|
||||||
|
vf.version=3
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
### direct log message to stdout ###
|
||||||
|
log4j.appender.stdout.Target = System.out
|
||||||
|
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||||
|
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||||
|
|
||||||
|
log4j.rootLogger=INFO, stdout
|
||||||
|
#debug,info,warning,error
|
@ -0,0 +1,22 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.admin.AuthorityDao">
|
||||||
|
<!-- 权限插入操作 -->
|
||||||
|
<insert id="add" parameterType="Authority">
|
||||||
|
insert into authority(id,roleId,menuId) values(null,#{roleId},#{menuId})
|
||||||
|
</insert>
|
||||||
|
<!-- 权限信息搜索查询 -->
|
||||||
|
<select id="findListByRoleId" parameterType="Long" resultType="Authority">
|
||||||
|
select * from authority
|
||||||
|
<if test="_parameter != null">
|
||||||
|
where roleId = #{roleId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 删除权限信息 -->
|
||||||
|
<delete id="deleteByRoleId" parameterType="Long">
|
||||||
|
delete from authority where roleId = #{roleId}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,31 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.admin.LogDao">
|
||||||
|
<!-- 日志插入操作 -->
|
||||||
|
<insert id="add" parameterType="com.ischoolbar.programmer.entity.admin.Log">
|
||||||
|
insert into log(id,content,createTime) values(null,#{content},#{createTime})
|
||||||
|
</insert>
|
||||||
|
<!-- 日志信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.admin.Log">
|
||||||
|
select * from log
|
||||||
|
<if test="content != null">
|
||||||
|
where content like '%${content}%'
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from log
|
||||||
|
<if test="content != null">
|
||||||
|
where content like '%${content}%'
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 删除日志信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from log where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,53 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.admin.MenuDao">
|
||||||
|
<!-- 菜单插入操作 -->
|
||||||
|
<insert id="add" parameterType="Menu">
|
||||||
|
insert into menu(id,parentId,name,url,icon) values(null,#{parentId},#{name},#{url},#{icon})
|
||||||
|
</insert>
|
||||||
|
<!-- 菜单信息模糊分页搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="Menu">
|
||||||
|
select * from menu where 1 = 1
|
||||||
|
<if test="parentId != null">
|
||||||
|
and parentId = #{parentId}
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
and name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 菜单信息模糊分页搜索查询总记录数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from menu where 1 = 1
|
||||||
|
<if test="parentId != null">
|
||||||
|
and parentId = #{parentId}
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
and name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 获取顶级菜单信息 -->
|
||||||
|
<select id="findTopList" parameterType="Map" resultType="Menu">
|
||||||
|
select * from menu where parentId = 0
|
||||||
|
</select>
|
||||||
|
<!-- 获取某一分类的子菜单信息 -->
|
||||||
|
<select id="findChildernList" parameterType="Long" resultType="Menu">
|
||||||
|
select * from menu where parentId = #{parentId}
|
||||||
|
</select>
|
||||||
|
<!-- 根据菜单id获取菜单信息 -->
|
||||||
|
<select id="findListByIds" parameterType="String" resultType="Menu">
|
||||||
|
select * from menu where id in(${value})
|
||||||
|
</select>
|
||||||
|
<!-- 修改菜单信息 -->
|
||||||
|
<update id="edit" parameterType="Menu">
|
||||||
|
update menu set name = #{name},parentId = #{parentId},url = #{url},icon = #{icon} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 删除菜单信息 -->
|
||||||
|
<delete id="delete" parameterType="Long">
|
||||||
|
delete from menu where id = #{id}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,39 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.admin.RoleDao">
|
||||||
|
<!-- 角色插入操作 -->
|
||||||
|
<insert id="add" parameterType="Role">
|
||||||
|
insert into role(id,name,remark) values(null,#{name},#{remark})
|
||||||
|
</insert>
|
||||||
|
<!-- 角色信息模糊分页搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="role">
|
||||||
|
select * from role
|
||||||
|
<if test="name != null">
|
||||||
|
where name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 角色信息模糊分页搜索查询总记录数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from role
|
||||||
|
<if test="name != null">
|
||||||
|
where name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id获取角色 -->
|
||||||
|
<select id="find" parameterType="Long" resultType="Role">
|
||||||
|
select * from role where id = #{id}
|
||||||
|
</select>
|
||||||
|
<!-- 修改角色信息 -->
|
||||||
|
<update id="edit" parameterType="Role">
|
||||||
|
update role set name = #{name},remark = #{remark} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 删除角色信息 -->
|
||||||
|
<delete id="delete" parameterType="Long">
|
||||||
|
delete from role where id = #{id}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,55 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.admin.UserDao">
|
||||||
|
<!-- 根据用户名查找用户 -->
|
||||||
|
<select id="findByUsername" parameterType="String" resultType="User">
|
||||||
|
select * from user where username = #{username}
|
||||||
|
</select>
|
||||||
|
<!-- 添加用户 -->
|
||||||
|
<insert id="add" parameterType="User">
|
||||||
|
insert into user(id,username,password,roleId,photo,sex,age,address) values(null,#{username},#{password},#{roleId},#{photo},#{sex},#{age},#{address})
|
||||||
|
</insert>
|
||||||
|
<!-- 修改用户 -->
|
||||||
|
<update id="edit" parameterType="User">
|
||||||
|
update user set username = #{username},roleId = #{roleId},photo = #{photo},sex = #{sex},age = #{age},address = #{address} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 修改用户密码 -->
|
||||||
|
<update id="editPassword" parameterType="User">
|
||||||
|
update user set password = #{password} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 删除用户 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from user where id in(${value})
|
||||||
|
</delete>
|
||||||
|
<!-- 分页获取用户列表 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="User">
|
||||||
|
select * from user where 1 = 1
|
||||||
|
<if test="username != null">
|
||||||
|
and username like '%${username}%'
|
||||||
|
</if>
|
||||||
|
<if test="roleId != null">
|
||||||
|
and roleId = #{roleId}
|
||||||
|
</if>
|
||||||
|
<if test="sex != null">
|
||||||
|
and sex = #{sex}
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 获取符合结果的总记录数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from user where 1 = 1
|
||||||
|
<if test="username != null">
|
||||||
|
and username like '%${username}%'
|
||||||
|
</if>
|
||||||
|
<if test="roleId != null">
|
||||||
|
and roleId = #{roleId}
|
||||||
|
</if>
|
||||||
|
<if test="sex != null">
|
||||||
|
and sex = #{sex}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,58 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.common.AccountDao">
|
||||||
|
<!-- 客户插入操作 -->
|
||||||
|
<insert id="add" parameterType="com.ischoolbar.programmer.entity.common.Account">
|
||||||
|
insert into account(id,name,password,email,trueName,sex,status,createTime) values(null,#{name},#{password},#{email},#{trueName},#{sex},#{status},#{createTime})
|
||||||
|
</insert>
|
||||||
|
<!-- 客户更新操作 -->
|
||||||
|
<update id="edit" parameterType="com.ischoolbar.programmer.entity.common.Account">
|
||||||
|
update account set name = #{name},password = #{password},email = #{email},trueName = #{trueName},sex = #{sex},status = #{status} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 客户信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.common.Account">
|
||||||
|
select * from account where 1 = 1
|
||||||
|
<if test="name != null">
|
||||||
|
and name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="sex != null">
|
||||||
|
and sex = #{sex}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="orderBy != null and sort != null">
|
||||||
|
order by ${orderBy} ${sort}
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from account where 1 = 1
|
||||||
|
<if test="name != null">
|
||||||
|
and name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="sex != null">
|
||||||
|
and sex = #{sex}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id查询 -->
|
||||||
|
<select id="findById" parameterType="Long" resultType="com.ischoolbar.programmer.entity.common.Account">
|
||||||
|
select * from account where id = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 根据用户名查询 -->
|
||||||
|
<select id="findByName" parameterType="String" resultType="com.ischoolbar.programmer.entity.common.Account">
|
||||||
|
select * from account where name = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 删除客户信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from account where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,84 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.common.CommentDao">
|
||||||
|
<resultMap id="commentResultMap" type="com.ischoolbar.programmer.entity.common.Comment">
|
||||||
|
<id column="c_id" property="id" />
|
||||||
|
<result column="c_productId" property="productId" />
|
||||||
|
<result column="c_userId" property="userId" />
|
||||||
|
<result column="c_type" property="type" />
|
||||||
|
<result column="c_content" property="content" />
|
||||||
|
<result column="c_createTime" property="createTime" />
|
||||||
|
<association property="product" javaType="com.ischoolbar.programmer.entity.common.Product">
|
||||||
|
<id column="p_id" property="id" />
|
||||||
|
<result column="p_name" property="name" />
|
||||||
|
<result column="p_imageUrl" property="imageUrl" />
|
||||||
|
<result column="p_price" property="price" />
|
||||||
|
</association>
|
||||||
|
<association property="account" javaType="com.ischoolbar.programmer.entity.common.Account">
|
||||||
|
<id column="a_id" property="id" />
|
||||||
|
<result column="a_name" property="name" />
|
||||||
|
</association>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 评论插入操作 -->
|
||||||
|
<insert id="add" parameterType="com.ischoolbar.programmer.entity.common.Comment">
|
||||||
|
insert into comment(id,productId,userId,type,content,createTime) values(null,#{productId},#{userId},#{type},#{content},#{createTime})
|
||||||
|
</insert>
|
||||||
|
<!-- 评论更新操作 -->
|
||||||
|
<update id="edit" parameterType="com.ischoolbar.programmer.entity.common.Comment">
|
||||||
|
update comment set type = #{type},content = #{content} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 评论信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultMap="commentResultMap">
|
||||||
|
select
|
||||||
|
c.id as c_id,c.productId as c_productId,c.userId as c_userId,c.type as c_type,c.content as c_content,c.createTime as c_createTime,
|
||||||
|
p.id as p_id,p.name as p_name,p.imageUrl as p_imageUrl,p.price as p_price,
|
||||||
|
a.id as a_id,a.name as a_name
|
||||||
|
from comment c,product p,account a where c.productId = p.id and c.userId = a.id
|
||||||
|
<if test="productName != null">
|
||||||
|
and p.name like '%${productName}%'
|
||||||
|
</if>
|
||||||
|
<if test="productId != null">
|
||||||
|
and p.id = #{productId}
|
||||||
|
</if>
|
||||||
|
<if test="username != null">
|
||||||
|
and a.name like '%${username}%'
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
and c.userId = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
and c.type = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="orderBy != null and sort != null">
|
||||||
|
order by ${orderBy} ${sort}
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from comment c,product p,account a where c.productId = p.id and c.userId = a.id
|
||||||
|
<if test="productName != null">
|
||||||
|
and p.name like '%${productId}%'
|
||||||
|
</if>
|
||||||
|
<if test="username != null">
|
||||||
|
and a.name like '%${username}%'
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
and c.type = #{type}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id查询 -->
|
||||||
|
<select id="findById" parameterType="Long" resultType="com.ischoolbar.programmer.entity.common.Comment">
|
||||||
|
select * from comment where id = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 删除评论信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from comment where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,85 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.common.OrderDao">
|
||||||
|
<!-- 订单插入操作 -->
|
||||||
|
<insert id="add" useGeneratedKeys="true" keyProperty="id" parameterType="com.ischoolbar.programmer.entity.common.Order">
|
||||||
|
insert into orders(id,sn,userId,address,money,productNum,status,remark,createTime) values(null,#{sn},#{userId},#{address},#{money},#{productNum},#{status},#{remark},#{createTime})
|
||||||
|
</insert>
|
||||||
|
<!-- 订单子项插入操作 -->
|
||||||
|
<insert id="addItem" parameterType="com.ischoolbar.programmer.entity.common.OrderItem">
|
||||||
|
insert into order_item(id,orderId,productId,name,imageUrl,price,num,money) values(null,#{orderId},#{productId},#{name},#{imageUrl},#{price},#{num},#{money})
|
||||||
|
</insert>
|
||||||
|
<!-- 订单更新操作 -->
|
||||||
|
<update id="edit" parameterType="com.ischoolbar.programmer.entity.common.Order">
|
||||||
|
update orders set address = #{address},money = #{money},status = #{status},remark = #{remark} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 订单信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.common.Order">
|
||||||
|
select * from orders where 1 = 1
|
||||||
|
<if test="sn != null">
|
||||||
|
and sn like '%${sn}%'
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
and userId = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="moneyMin != null">
|
||||||
|
and money > #{moneyMin}
|
||||||
|
</if>
|
||||||
|
<if test="moneyMax != null">
|
||||||
|
and money < #{moneyMax}
|
||||||
|
</if>
|
||||||
|
<if test="orderBy != null and sort != null">
|
||||||
|
order by ${orderBy} ${sort}
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from orders where 1 = 1
|
||||||
|
<if test="sn != null">
|
||||||
|
and sn like '%${sn}%'
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
and userId = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="moneyMin != null">
|
||||||
|
and money > #{moneyMin}
|
||||||
|
</if>
|
||||||
|
<if test="moneyMax != null">
|
||||||
|
and money < #{moneyMax}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id查询 -->
|
||||||
|
<select id="findById" parameterType="Long" resultType="com.ischoolbar.programmer.entity.common.Order">
|
||||||
|
select * from orders where id = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 根据orderId查询订单子项 -->
|
||||||
|
<select id="findOrderItemList" parameterType="Long" resultType="com.ischoolbar.programmer.entity.common.OrderItem">
|
||||||
|
select * from order_item where orderId = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 统计指定时间段内的销售额 -->
|
||||||
|
<select id="getStats" parameterType="Map" resultType="Map">
|
||||||
|
select sum(money) as money,DATE_FORMAT(createTime,"%Y%m%d") as date from orders where 1 = 1
|
||||||
|
<if test="startTime != null">
|
||||||
|
and createTime > #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
and createTime < #{endTime}
|
||||||
|
</if>
|
||||||
|
GROUP BY DATE_FORMAT(createTime,"%Y%m%d")
|
||||||
|
</select>
|
||||||
|
<!-- 删除订单信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from orders where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,39 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.common.ProductCategoryDao">
|
||||||
|
<!-- 商品分类插入操作 -->
|
||||||
|
<insert id="add" parameterType="com.ischoolbar.programmer.entity.common.ProductCategory">
|
||||||
|
insert into product_category(id,parentId,name,tags,remark) values(null,#{parentId},#{name},#{tags},#{remark})
|
||||||
|
</insert>
|
||||||
|
<!-- 商品分类更新操作 -->
|
||||||
|
<update id="edit" parameterType="com.ischoolbar.programmer.entity.common.ProductCategory">
|
||||||
|
update product_category set parentId = #{parentId},name = #{name},tags = #{tags},remark = #{remark} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 商品分类信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.common.ProductCategory">
|
||||||
|
select * from product_category
|
||||||
|
<if test="name != null">
|
||||||
|
where name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from product_category
|
||||||
|
<if test="name != null">
|
||||||
|
where name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id查询分类 -->
|
||||||
|
<select id="findById" parameterType="Long" resultType="com.ischoolbar.programmer.entity.common.ProductCategory">
|
||||||
|
select * from product_category where id = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 删除商品分类信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from product_category where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,64 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.common.ProductDao">
|
||||||
|
<!-- 商品插入操作 -->
|
||||||
|
<insert id="add" parameterType="com.ischoolbar.programmer.entity.common.Product">
|
||||||
|
insert into product(id,productCategoryId,name,tags,imageUrl,price,stock,sellNum,viewNum,commentNum,content,createTime) values(null,#{productCategoryId},#{name},#{tags},#{imageUrl},#{price},#{stock},#{sellNum},#{viewNum},#{commentNum},#{content},#{createTime})
|
||||||
|
</insert>
|
||||||
|
<!-- 商品更新操作 -->
|
||||||
|
<update id="edit" parameterType="com.ischoolbar.programmer.entity.common.Product">
|
||||||
|
update product set productCategoryId = #{productCategoryId},name = #{name},tags = #{tags},imageUrl = #{imageUrl},price = #{price},stock = #{stock},content = #{content} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 商品统计数量更新 -->
|
||||||
|
<update id="updateNum" parameterType="com.ischoolbar.programmer.entity.common.Product">
|
||||||
|
update product set stock = #{stock},sellNum = #{sellNum},viewNum = #{viewNum},commentNum = #{commentNum} where id = #{id}
|
||||||
|
</update>
|
||||||
|
<!-- 商品信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.common.Product">
|
||||||
|
select * from product where 1 = 1
|
||||||
|
<if test="name != null">
|
||||||
|
and name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="tags != null">
|
||||||
|
and tags like '%${tags}%'
|
||||||
|
</if>
|
||||||
|
<if test="priceMin != null">
|
||||||
|
and price > #{priceMin}
|
||||||
|
</if>
|
||||||
|
<if test="priceMax != null">
|
||||||
|
and price < #{priceMax}
|
||||||
|
</if>
|
||||||
|
<if test="orderBy != null and sort != null">
|
||||||
|
order by ${orderBy} ${sort}
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from product where 1 = 1
|
||||||
|
<if test="name != null">
|
||||||
|
and name like '%${name}%'
|
||||||
|
</if>
|
||||||
|
<if test="tags != null">
|
||||||
|
and tags in(${tags})
|
||||||
|
</if>
|
||||||
|
<if test="priceMin != null">
|
||||||
|
and price > #{priceMin}
|
||||||
|
</if>
|
||||||
|
<if test="priceMax != null">
|
||||||
|
and price < #{priceMax}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id查询 -->
|
||||||
|
<select id="findById" parameterType="Long" resultType="com.ischoolbar.programmer.entity.common.Product">
|
||||||
|
select * from product where id = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 删除商品信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from product where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,39 @@
|
|||||||
|
<?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.ischoolbar.programmer.dao.home.AddressDao">
|
||||||
|
<!-- 收货地址插入操作 -->
|
||||||
|
<insert id="add" parameterType="com.ischoolbar.programmer.entity.home.Address">
|
||||||
|
insert into address(id,userId,name,phone,address,createTime) values(null,#{userId},#{name},#{phone},#{address},#{createTime})
|
||||||
|
</insert>
|
||||||
|
<!-- 收货地址更新操作 -->
|
||||||
|
<update id="edit" parameterType="com.ischoolbar.programmer.entity.home.Address">
|
||||||
|
update address set name = #{name},phone = #{phone},address = #{address} where id = #{id} and userId = #{userId}
|
||||||
|
</update>
|
||||||
|
<!-- 收货地址信息搜索查询 -->
|
||||||
|
<select id="findList" parameterType="Map" resultType="com.ischoolbar.programmer.entity.home.Address">
|
||||||
|
select * from address where 1 = 1
|
||||||
|
<if test="userId != null">
|
||||||
|
and userId = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="offset != null and pageSize != null">
|
||||||
|
limit #{offset},#{pageSize}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 模糊搜索总条数 -->
|
||||||
|
<select id="getTotal" parameterType="Map" resultType="Integer">
|
||||||
|
select count(*) from address where 1 = 1
|
||||||
|
<if test="userId != null">
|
||||||
|
and userId = #{userId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<!-- 根据id查询 -->
|
||||||
|
<select id="findById" parameterType="Long" resultType="com.ischoolbar.programmer.entity.home.Address">
|
||||||
|
select * from address where id = #{value}
|
||||||
|
</select>
|
||||||
|
<!-- 删除收货地址信息 -->
|
||||||
|
<delete id="delete" parameterType="String">
|
||||||
|
delete from address where id in(${value})
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue