org.apache.ibatis.annotations.Mapper类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(213)

本文整理了Java中org.apache.ibatis.annotations.Mapper类的一些代码示例,展示了Mapper类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mapper类的具体详情如下:
包路径:org.apache.ibatis.annotations.Mapper
类名称:Mapper

Mapper介绍

暂无

代码示例

代码示例来源:origin: xuxueli/xxl-job

  1. /**
  2. * Created by xuxueli on 16/9/30.
  3. */
  4. @Mapper
  5. public interface XxlJobGroupDao {
  6. public List<XxlJobGroup> findAll();
  7. public List<XxlJobGroup> findByAddressType(@Param("addressType") int addressType);
  8. public int save(XxlJobGroup xxlJobGroup);
  9. public int update(XxlJobGroup xxlJobGroup);
  10. public int remove(@Param("id") int id);
  11. public XxlJobGroup load(@Param("id") int id);
  12. }

代码示例来源:origin: xuxueli/xxl-job

  1. /**
  2. * job log for glue
  3. * @author xuxueli 2016-5-19 18:04:56
  4. */
  5. @Mapper
  6. public interface XxlJobLogGlueDao {
  7. public int save(XxlJobLogGlue xxlJobLogGlue);
  8. public List<XxlJobLogGlue> findByJobId(@Param("jobId") int jobId);
  9. public int removeOld(@Param("jobId") int jobId, @Param("limit") int limit);
  10. public int deleteByJobId(@Param("jobId") int jobId);
  11. }

代码示例来源:origin: qiurunze123/miaosha

  1. @Mapper
  2. public interface MiaoShaUserDao {
  3. @Select("select * from miaosha_user where nickname = #{nickname}")
  4. public MiaoshaUser getByNickname(@Param("nickname") String nickname ) ;
  5. @Select("select * from miaosha_user where id = #{id}")
  6. public MiaoshaUser getById(@Param("id") long id ) ;
  7. @Update("update miaosha_user set password = #{password} where id = #{id}")
  8. public void update(MiaoshaUser toBeUpdate);
  9. @Insert("insert into miaosha_user (id , nickname ,password , salt ,head,register_date,last_login_date)value (#{id},#{nickname},#{password},#{salt},#{head},#{registerDate},#{lastLoginDate}) ")
  10. @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
  11. public void insertMiaoShaUser(MiaoshaUser miaoshaUser);
  12. }

代码示例来源:origin: qiurunze123/miaosha

  1. @Mapper
  2. public interface UserDao {
  3. @Select("select * from user where id = #{id}")
  4. public User getById(@Param("id")int id);
  5. @Insert("insert into user (id, name) values(#{id}, #{name})")
  6. public int insert(User user);
  7. }

代码示例来源:origin: qiurunze123/miaosha

  1. @Mapper
  2. public interface GoodsDao {
  3. @Select("select g.*,mg.stock_count, mg.start_date, mg.end_date,mg.miaosha_price from miaosha_goods mg left join goods g on mg.goods_id = g.id")
  4. public List<GoodsVo> listGoodsVo();
  5. @Select("select g.*,mg.stock_count, mg.start_date, mg.end_date,mg.miaosha_price from miaosha_goods mg left join goods g on mg.goods_id = g.id where g.id = #{goodsId}")
  6. public GoodsVo getGoodsVoByGoodsId(@Param("goodsId") long goodsId);
  7. @Update("update miaosha_goods set stock_count = stock_count - 1 where goods_id = #{goodsId} and stock_count > 0")
  8. public int reduceStock(MiaoshaGoods g);
  9. }

代码示例来源:origin: xuxueli/xxl-job

  1. /**
  2. * Created by xuxueli on 16/9/30.
  3. */
  4. @Mapper
  5. public interface XxlJobRegistryDao {
  6. public int removeDead(@Param("timeout") int timeout);
  7. public List<XxlJobRegistry> findAll(@Param("timeout") int timeout);
  8. public int registryUpdate(@Param("registryGroup") String registryGroup,
  9. @Param("registryKey") String registryKey,
  10. @Param("registryValue") String registryValue);
  11. public int registrySave(@Param("registryGroup") String registryGroup,
  12. @Param("registryKey") String registryKey,
  13. @Param("registryValue") String registryValue);
  14. public int registryDelete(@Param("registryGroup") String registGroup,
  15. @Param("registryKey") String registryKey,
  16. @Param("registryValue") String registryValue);
  17. }

代码示例来源:origin: roncoo/spring-boot-demo

  1. @Mapper
  2. public interface RoncooUserMapper {
  3. @Insert(value = "insert into roncoo_user (name, create_time) values (#{name,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})")
  4. int insert(RoncooUser record);
  5. @Select(value = "select id, name, create_time from roncoo_user where id = #{id,jdbcType=INTEGER}")
  6. @Results(value = { @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP) })
  7. RoncooUser selectByPrimaryKey(Integer id);
  8. }

代码示例来源:origin: qiurunze123/miaosha

  1. @Mapper
  2. public interface OrderDao {
  3. @Select("select * from miaosha_order where user_id=#{userNickName} and goods_id=#{goodsId}")
  4. public MiaoshaOrder getMiaoshaOrderByUserIdGoodsId(@Param("userNickName") long userNickName, @Param("goodsId") long goodsId);
  5. @Insert("insert into order_info(user_id, goods_id, goods_name, goods_count, goods_price, order_channel, status, create_date)values("
  6. + "#{userId}, #{goodsId}, #{goodsName}, #{goodsCount}, #{goodsPrice}, #{orderChannel},#{status},#{createDate} )")
  7. @SelectKey(keyColumn="id", keyProperty="id", resultType=long.class, before=false, statement="select last_insert_id()")
  8. public long insert(OrderInfo orderInfo);
  9. @Insert("insert into miaosha_order (user_id, goods_id, order_id)values(#{userId}, #{goodsId}, #{orderId})")
  10. public int insertMiaoshaOrder(MiaoshaOrder miaoshaOrder);
  11. @Select("select * from order_info where id = #{orderId}")
  12. public OrderInfo getOrderById(@Param("orderId")long orderId);
  13. @Select("select * from order_info where status=#{status} and create_Date<=#{createDate}")
  14. public List<OrderInfo> selectOrderStatusByCreateTime(@Param("status")Integer status, @Param("createDate") String createDate);
  15. @Select("update order_info set status=0 where id=#{id}")
  16. public int closeOrderByOrderInfo();
  17. }

代码示例来源:origin: xuxueli/xxl-job

  1. @Mapper
  2. public interface XxlJobInfoDao {

代码示例来源:origin: qiurunze123/miaosha

  1. @Mapper
  2. public interface MiaoShaMessageDao {
  3. @Select("select * from miaosha_message where messageid = #{messageid} ")
  4. public List<MiaoShaMessageInfo> listMiaoShaMessage(@Param("messageId") String messageId);
  5. @Select("<script>select * from miaosha_message_user where 1=1 <if test=\"messageId !=null \">and messageId = #{messageId} </if></script>")
  6. public List<MiaoShaMessageUser> listMiaoShaMessageUser(@Param("messageId") String messageId);
  7. @Insert("insert into miaosha_message (id , messageid ,content , create_time ,status,over_time,message_type ,send_type , good_name , price,messageHead)" +
  8. "value (#{id},#{messageId},#{content},#{createTime},#{status},#{overTime},#{messageType},#{sendType},#{goodName},#{price},#{messageHead}) ")
  9. @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
  10. public void insertMiaoShaMessage(MiaoShaMessageInfo miaoShaMessage);
  11. @Insert("insert into miaosha_message_user (id , userid ,messageid , goodid ,orderid)" +
  12. "value (#{id},#{userId},#{messageId},#{goodId},#{orderId}) ")
  13. @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
  14. public void insertMiaoShaMessageUser(MiaoShaMessageUser miaoShaMessageUser);
  15. @Select(" <script> select * from miaosha_message_user mmu , miaosha_message mm where " +
  16. " mmu.messageid = mm.messageid and userid=${userId} <if test=\"status !=null \">and status = #{status} </if></script> ")
  17. public List<MiaoShaMessageInfo> listMiaoShaMessageByUserId(@Param("userId") long userId,@Param("status") Integer status );
  18. }

代码示例来源:origin: ChinaSilence/any-video

  1. @Mapper
  2. public interface AttentionMapper {
  3. @Insert("insert into any_attention(user_id, other_id) values(#{userId}, #{otherId})")
  4. int insert(Attention attention);
  5. @Delete("delete from any_attention where user_id = #{userId} and other_id = #{otherId}")
  6. int delete(@Param("userId") Long userId, @Param("otherId") Long otherId);
  7. @Select("select * from any_attention where user_id = #{userId} and other_id = #{otherId}")
  8. Attention select(@Param("userId") Long userId, @Param("otherId") Long otherId);
  9. }

代码示例来源:origin: ChinaSilence/any-video

  1. /**
  2. * 打赏
  3. */
  4. @Mapper
  5. public interface TipMapper {
  6. @Select("SELECT * FROM any_tip ORDER BY id DESC")
  7. List<Tip> list();
  8. }

代码示例来源:origin: cachecats/coderiver

  1. /**
  2. * @Author: solo
  3. * @Date: 2018/12/12 2:30 PM
  4. * @Version 1.0
  5. */
  6. @Mapper
  7. public interface ProjectCategoryMapper {
  8. int insert(ProjectCategory category);
  9. int deleteByType(Integer type);
  10. int updateByType(ProjectCategory category);
  11. ProjectCategory selectByType(Integer type);
  12. }

代码示例来源:origin: cachecats/coderiver

  1. /**
  2. * @Author: solo
  3. * @Date: 2018/12/12 6:48 PM
  4. * @Version 1.0
  5. */
  6. @Mapper
  7. public interface ProjectMemberMapper {
  8. List<ProjectMember> selectByProjectId(String projectId);
  9. }

代码示例来源:origin: roncoo/spring-boot-demo

  1. @Mapper
  2. public interface RoncooUserLogMapper {
  3. int countByExample(RoncooUserLogExample example);
  4. int deleteByExample(RoncooUserLogExample example);
  5. int deleteByPrimaryKey(Integer id);
  6. int insert(RoncooUserLog record);
  7. int insertSelective(RoncooUserLog record);
  8. List<RoncooUserLog> selectByExample(RoncooUserLogExample example);
  9. RoncooUserLog selectByPrimaryKey(Integer id);
  10. int updateByExampleSelective(@Param("record") RoncooUserLog record, @Param("example") RoncooUserLogExample example);
  11. int updateByExample(@Param("record") RoncooUserLog record, @Param("example") RoncooUserLogExample example);
  12. int updateByPrimaryKeySelective(RoncooUserLog record);
  13. int updateByPrimaryKey(RoncooUserLog record);
  14. }

代码示例来源:origin: roncoo/spring-boot-demo

  1. @Mapper
  2. public interface RoncooUserMapper {
  3. int countByExample(RoncooUserExample example);
  4. int deleteByExample(RoncooUserExample example);
  5. int deleteByPrimaryKey(Integer id);
  6. int insert(RoncooUser record);
  7. int insertSelective(RoncooUser record);
  8. List<RoncooUser> selectByExample(RoncooUserExample example);
  9. RoncooUser selectByPrimaryKey(Integer id);
  10. int updateByExampleSelective(@Param("record") RoncooUser record, @Param("example") RoncooUserExample example);
  11. int updateByExample(@Param("record") RoncooUser record, @Param("example") RoncooUserExample example);
  12. int updateByPrimaryKeySelective(RoncooUser record);
  13. int updateByPrimaryKey(RoncooUser record);
  14. }

代码示例来源:origin: roncoo/spring-boot-demo

  1. @Mapper
  2. public interface RoncooUserMapper {
  3. int countByExample(RoncooUserExample example);
  4. int deleteByExample(RoncooUserExample example);
  5. int deleteByPrimaryKey(Integer id);
  6. int insert(RoncooUser record);
  7. int insertSelective(RoncooUser record);
  8. List<RoncooUser> selectByExample(RoncooUserExample example);
  9. RoncooUser selectByPrimaryKey(Integer id);
  10. int updateByExampleSelective(@Param("record") RoncooUser record, @Param("example") RoncooUserExample example);
  11. int updateByExample(@Param("record") RoncooUser record, @Param("example") RoncooUserExample example);
  12. int updateByPrimaryKeySelective(RoncooUser record);
  13. int updateByPrimaryKey(RoncooUser record);
  14. }

代码示例来源:origin: roncoo/spring-boot-demo

  1. @Mapper
  2. public interface RoncooUserLogMapper {
  3. int countByExample(RoncooUserLogExample example);
  4. int deleteByExample(RoncooUserLogExample example);
  5. int deleteByPrimaryKey(Integer id);
  6. int insert(RoncooUserLog record);
  7. int insertSelective(RoncooUserLog record);
  8. List<RoncooUserLog> selectByExample(RoncooUserLogExample example);
  9. RoncooUserLog selectByPrimaryKey(Integer id);
  10. int updateByExampleSelective(@Param("record") RoncooUserLog record, @Param("example") RoncooUserLogExample example);
  11. int updateByExample(@Param("record") RoncooUserLog record, @Param("example") RoncooUserLogExample example);
  12. int updateByPrimaryKeySelective(RoncooUserLog record);
  13. int updateByPrimaryKey(RoncooUserLog record);
  14. }

代码示例来源:origin: qiurunze123/miaosha

  1. @Mapper
  2. public interface UserMapper {

代码示例来源:origin: xuxueli/xxl-job

  1. @Mapper
  2. public interface XxlJobLogDao {

相关文章

Mapper类方法