src/com/shop/mapper/OsCommentMapper.xml
(完整代码) 2KB<?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.shop.dao.OsCommentMapper">
<resultMap id="commentMap" type="com.shop.po.OsComment">
<id column="id" property="id" />
<association property="good" select="getGoodById" column="gid"></association>
<association property="user" select="getUserById" column="uid"></association>
</resultMap>
<resultMap id="umap" type="com.shop.po.OsUser">
<id column="user_id" jdbcType="BIGINT" property="userId" />
<result column="user_number" jdbcType="BIGINT" property="userNumber" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="login_password" jdbcType="VARCHAR" property="loginPassword" />
<result column="real_name" jdbcType="VARCHAR" property="realName" />
<result column="sex" jdbcType="BIT" property="sex" />
<result column="age" jdbcType="TINYINT" property="age" />
<result column="pic_img" jdbcType="VARCHAR" property="picImg" />
<result column="status" jdbcType="BIT" property="status" />
<result column="telephone" jdbcType="VARCHAR" property="telephone" />
<result column="regeist_time" jdbcType="TIMESTAMP" property="regeistTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap id="goodmap" type="com.shop.po.OsProduct">
<id column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="product_number" jdbcType="BIGINT" property="productNumber"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="show_price" jdbcType="DECIMAL" property="showPrice"/>
<result column="introduce" jdbcType="VARCHAR" property="introduce"/>
<result column="pic_img" jdbcType="VARCHAR" property="picImg"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="page_title" jdbcType="VARCHAR" property="pageTitle"/>
<result column="page_description" jdbcType="VARCHAR" property="pageDescription"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
</resultMap>
<select id="getUserById" resultMap="umap">
select * from os_user where user_id=#{id}
</select>
<select id="getGoodById" resultMap="goodmap">
select * from os_product where product_id=#{id}
</select>
<select id="getByGoodId" resultMap="commentMap">
select * from os_comment where gid=#{id}
</select>
<insert id="add" parameterType="com.shop.po.OsComment" >
insert into os_comment values(null,#{gid},#{uid},#{con},#{createtime})
</insert>
<update id="update" parameterType="com.shop.po.OsComment" >
update os_comment set con=#{con} where id=#{id}
</update>
<delete id="del">
delete from os_comment where id=#{id}
</delete>
</mapper>
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。