build/classes/config/mybatis/mapper/common/OrderMapper.xml

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?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 &gt; #{moneyMin}  
		</if>
		<if test="moneyMax != null">
			and money &lt; #{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 &gt; #{moneyMin}  
		</if>
		<if test="moneyMax != null">
			and money &lt; #{moneyMax}  
		</if>
后面还有 25 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。