dto的Rsp的导出时,数据库存储不同状态,1为好,2为坏,3为不好,等等
public String getStatusDesc() { if (status != null) { switch (status) { case 0: return "好"; case 1: return "坏"; case 2: return "不好"; } } return ""; }
导出时时间的转换注解
@Excel(name = "时间", orderNum = "0", isImportField = "true", exportFormat = "yyyy-MM-dd HH:mm:ss", importFormat = "yyyy-MM-dd HH:mm:ss", databaseFormat = "yyyy-MM-dd HH:mm:ss")
强大的mapping搜索方法
<mapper namespace="com.chongxuan.web.common.dao.xxMapper"> <select id="findList" resultType="com.chongxuan.web.common.dto.vo.xx.Rspxx"> select * from table_name <where> <if test="req.user_name != null and req.user_name != ''"> and user_name = #{req.user_name} or user_id = #{req.user_name} </if> <if test="req.startTime != null and req.startTime !=''"> and DATE(create_time) >= #{req.startTime} and DATE(create_time) <= #{req.endTime} </if> </where> order by create_time desc </select>