<insert id="insertArea" useGeneratedKeys="true" keyProperty="areaId" keyColumn="area_id" parameterType="com.imooc.demo.entity.Area">
INSERT INTO tb_area(area_name, priority, create_time, last_edit_time)
VALUES(#{areaName},#{priority},#{createTime},#{lastEditTime})
</insert>
INSERT INTO tb_area(area_name, priority, create_time, last_edit_time)
VALUES(#{areaName},#{priority},#{createTime},#{lastEditTime})
</insert>
2019-11-18
<select id="queryAreaById" resultType="com.imooc.demo.entity.Area">
SELECT area_id,area_name,priority,create_time,last_edit_time
FROM tb_area
WHERE
area_id=#{areaId}
</select>
SELECT area_id,area_name,priority,create_time,last_edit_time
FROM tb_area
WHERE
area_id=#{areaId}
</select>
2019-11-18
<select id="queryArea" resultType="com.imooc.demo.entity.Area">
SELECT area_id,area_name,priority,create_time,last_edit_time
FROM tb_area
ORDER BY priority
DESC
</select>
SELECT area_id,area_name,priority,create_time,last_edit_time
FROM tb_area
ORDER BY priority
DESC
</select>
2019-11-18