|
|
@@ -2,73 +2,80 @@ |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
<mapper namespace="com.simple.mapper.WxCarCmdLogMapper"> |
|
|
<mapper namespace="com.simple.mapper.WxCarCmdLogMapper"> |
|
|
<resultMap id="BaseResultMap" type="com.simple.domain.po.WxCarCmdLog"> |
|
|
<resultMap id="BaseResultMap" type="com.simple.domain.po.WxCarCmdLog"> |
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
|
|
<result column="vendor_type" jdbcType="INTEGER" property="vendorType" /> |
|
|
|
|
|
<result column="cmd_type" jdbcType="INTEGER" property="cmdType" /> |
|
|
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> |
|
|
|
|
|
<result column="cmd_json" jdbcType="VARCHAR" property="cmdJson" /> |
|
|
|
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
|
|
<result column="vendor_type" jdbcType="INTEGER" property="vendorType"/> |
|
|
|
|
|
<result column="cmd_type" jdbcType="INTEGER" property="cmdType"/> |
|
|
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> |
|
|
|
|
|
<result column="cmd_json" jdbcType="VARCHAR" property="cmdJson"/> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
<sql id="allColumns"> |
|
|
`id`,`tenant_id`,`vendor_type`,`cmd_type`,`create_date`,`update_date`,`cmd_json` |
|
|
`id`,`tenant_id`,`vendor_type`,`cmd_type`,`create_date`,`update_date`,`cmd_json` |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
<sql id="dynamicWhereConditions"> |
|
|
where 1 = 1 |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
|
|
and `id` = #{id} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
|
|
and `tenant_id` like concat('%', #{tenantId},'%') |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != vendorType "> |
|
|
|
|
|
and `vendor_type` = #{vendorType} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != cmdType "> |
|
|
|
|
|
and `cmd_type` = #{cmdType} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
|
|
and `create_date` = #{createDate} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
|
|
and `update_date` = #{updateDate} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != cmdJson "> |
|
|
|
|
|
and `cmd_json` like concat('%', #{cmdJson},'%') |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
|
|
and `id` = #{id} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
|
|
and `tenant_id` like concat('%', #{tenantId},'%') |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != vendorType "> |
|
|
|
|
|
and `vendor_type` = #{vendorType} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != cmdType "> |
|
|
|
|
|
and `cmd_type` = #{cmdType} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
|
|
and `create_date` = #{createDate} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
|
|
and `update_date` = #{updateDate} |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != cmdJson "> |
|
|
|
|
|
and `cmd_json` like concat('%', #{cmdJson},'%') |
|
|
|
|
|
|
|
|
|
|
|
</if> |
|
|
<if test=" null != ids "> |
|
|
<if test=" null != ids "> |
|
|
and id in |
|
|
|
|
|
|
|
|
and id in |
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
#{idItem} |
|
|
|
|
|
|
|
|
#{idItem} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
|
|
|
<if test=" null != sortColumns"> order by ${sortColumns} </if> |
|
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<select id="findList" parameterType="com.simple.domain.po.WxCarCmdLog" resultMap="BaseResultMap"> |
|
|
<select id="findList" parameterType="com.simple.domain.po.WxCarCmdLog" resultMap="BaseResultMap"> |
|
|
select <include refid="allColumns" /> from wx_car_cmd_log |
|
|
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
|
|
|
|
|
select |
|
|
|
|
|
<include refid="allColumns"/> |
|
|
|
|
|
from wx_car_cmd_log |
|
|
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="queryHistory" resultType="hashmap" parameterType="hashmap"> |
|
|
|
|
|
select count(c.id) carcount,c.create_date from ( |
|
|
|
|
|
select id,DATE_FORMAT(create_date,'%Y-%m-%d') create_date |
|
|
|
|
|
from wx_car_cmd_log where tenant_id = #{tenantId} and cmd_type=#{cmdType} |
|
|
|
|
|
and create_date BETWEEN #{startdate} and #{enddate} |
|
|
|
|
|
) c |
|
|
|
|
|
group by c.create_date |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |