1以注解方式
//两个参数其中一个是对象需写,对象.属性 @Update("update delivery_address set consignee = #{address.consignee},country = #{address.country},city = #{address.city},address = #{address.address},phone_number = #{address.phoneNumber},telnumber = #{address.telNumber},zipcode = #{address.zipcode},update_time = UNIX_TIMESTAMP(NOW())*1000 where id = #{id}") void update(@Param("address") Address address, @Param("id") Long id);
OrderProvider.class
另外一种写法
@Select("<script>" + "SELECT COUNT(*) FROM excel_template " + " where create_uid = ${sqlMap.create_uid} and is_delete = 0 " + "<if test=\"sqlMap.end_time != null and sqlMap.end_time != ‘‘ \"> and UNIX_TIMESTAMP(create_date) ${sqlMap.end_time} </if>" + "<if test=\"sqlMap.start_time != null and sqlMap.start_time != ‘‘\"> and UNIX_TIMESTAMP(create_date) >= ${sqlMap.start_time} </if>" + "<if test=\"sqlMap.keyword != null and sqlMap.keyword != ‘‘\"> and (file_name like CONCAT(‘%‘,#{sqlMap.keyword},‘%‘) )</if>" + "</script>") int countList(PageBean<ExcelTemplate> pageBean);
原文地址:https://www.cnblogs.com/G-JF/p/9305262.html
时间: 2024-10-11 04:29:35