常用的注解

   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "修改时间")
    private Date updateDate;
 <if test="param.startUpdateDate != null ">
                AND r.update_date <![CDATA[  >= ]]> #{param.startUpdateDate,jdbcType=TIMESTAMP}
            </if>
            <if test="param.endUpdateDate != null ">
                AND r.update_date <![CDATA[ < ]]> date_add(#{param.endUpdateDate,jdbcType=TIMESTAMP},interval 1 day)
            </if>

有的时候会老是报错--无法将String类型的值去与Date类型比价,将test后面的   and param.startUpdateDate != '' " 去掉就可以了

 <if test="param.orderNumber != null and param.orderNumber != ''">
                and o.order_number like concat('%', #{param.orderNumber,jdbcType=VARCHAR}, '%')
            </if>
<if test="param.staffId != null and param.staffId != ''">
                and sc.user_id = #{param.staffId,jdbcType=VARCHAR}
            </if>

controller层注解:

@RequestMapping("/orderChange")
@RestController
{
          @RequestMapping(value = "/findByPage", method = RequestMethod.POST)
    @ApiOperation(value = "订单修改记录分页查询接口", httpMethod = "POST", notes = "订单修改记录分页查询接口", response = PageResMessage.class)      
}    

Service 层注解:

@Service
@Transactional(rollbackFor = Exception.class)

@Mapper Mapper层注解

猜你喜欢

转载自www.cnblogs.com/huanghuanghui/p/9552293.html