| | |
| | | |
| | | <!-- 根据UID或者设备号获取浏览记录 --> |
| | | <select id="selectByDeviceOrUid" resultMap="BaseResultMap"> |
| | | SELECT s.*,MAX(s.`s_createtime`) AS orderid FROM yeshi_ec_scanhistory_v2 s |
| | | select * from (SELECT s.* FROM yeshi_ec_scanhistory_v2 s |
| | | WHERE |
| | | <trim prefix="(" suffix=")" suffixOverrides="or"> |
| | | <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if> |
| | | <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if> |
| | | </trim> |
| | | GROUP BY s.`s_common_goods_id` ORDER BY orderid DESC limit |
| | | GROUP BY s.`s_common_goods_id` |
| | | ) s |
| | | order by s.s_createtime DESC |
| | | limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{userInfo.id,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ScanHistoryV2" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_scanhistory_v2 |